Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: ui/views/bubble/bubble_delegate.h

Issue 1455313002: [Reland][Extensions] Don't count bubble focus loss as acknowledgment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/bubble/bubble_delegate.h
diff --git a/ui/views/bubble/bubble_delegate.h b/ui/views/bubble/bubble_delegate.h
index 3bc73f8c729d0983f07d044dc78186e48cc472c5..1bd963405810e9e01b9891e584f1d940954628af 100644
--- a/ui/views/bubble/bubble_delegate.h
+++ b/ui/views/bubble/bubble_delegate.h
@@ -28,6 +28,13 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
// Internal class name.
static const char kViewClassName[];
+ enum class CloseReason {
+ DEACTIVATION,
+ ESCAPE,
+ CLOSE_BUTTON,
+ UNKNOWN,
+ };
+
BubbleDelegateView();
BubbleDelegateView(View* anchor_view, BubbleBorder::Arrow arrow);
~BubbleDelegateView() override;
@@ -44,6 +51,7 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
const char* GetClassName() const override;
// WidgetObserver overrides:
+ void OnWidgetClosing(Widget* widget) override;
void OnWidgetDestroying(Widget* widget) override;
void OnWidgetVisibilityChanging(Widget* widget, bool visible) override;
void OnWidgetVisibilityChanged(Widget* widget, bool visible) override;
@@ -93,6 +101,8 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
bool adjust_if_offscreen() const { return adjust_if_offscreen_; }
void set_adjust_if_offscreen(bool adjust) { adjust_if_offscreen_ = adjust; }
+ CloseReason close_reason() const { return close_reason_; }
+
// Get the arrow's anchor rect in screen space.
virtual gfx::Rect GetAnchorRect() const;
@@ -192,6 +202,8 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
// Parent native window of the bubble.
gfx::NativeView parent_window_;
+ CloseReason close_reason_;
+
DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView);
};

Powered by Google App Engine
This is Rietveld 408576698