#ifndef UI_BASE_COCOA_BUBBLE_CLOSER_H_
#define UI_BASE_COCOA_BUBBLE_CLOSER_H_
#include <memory>
#include "base/component_export.h"
#include "base/functional/callback.h"
#include "base/memory/weak_ptr.h"
#include "ui/gfx/native_ui_types.h"
namespace ui {
class COMPONENT_EXPORT(UI_BASE) BubbleCloser {
public:
BubbleCloser(gfx::NativeWindow window,
base::RepeatingClosure on_click_outside);
BubbleCloser(const BubbleCloser&) = delete;
BubbleCloser& operator=(const BubbleCloser&) = delete;
~BubbleCloser();
private:
void OnClickOutside();
base::RepeatingClosure on_click_outside_;
struct ObjCStorage;
std::unique_ptr<ObjCStorage> objc_storage_;
base::WeakPtrFactory<BubbleCloser> factory_{this};
};
}
#endif