Index: views/bubble/bubble_delegate.h |
diff --git a/views/bubble/bubble_delegate.h b/views/bubble/bubble_delegate.h |
index a5f6ab9993df841024f5f3c7338c098bf20af887..3304824bcd120cc59ffa77dd1e9f7c66b7bd9152 100644 |
--- a/views/bubble/bubble_delegate.h |
+++ b/views/bubble/bubble_delegate.h |
@@ -9,6 +9,7 @@ |
#include "base/gtest_prod_util.h" |
#include "ui/base/animation/animation_delegate.h" |
#include "views/bubble/bubble_border.h" |
+#include "views/focus/widget_focus_manager.h" |
#include "views/widget/widget_delegate.h" |
namespace ui { |
@@ -24,7 +25,8 @@ class BubbleFrameView; |
// |
/////////////////////////////////////////////////////////////////////////////// |
class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView, |
- public ui::AnimationDelegate { |
+ public ui::AnimationDelegate, |
+ public WidgetFocusChangeListener { |
public: |
BubbleDelegateView(); |
BubbleDelegateView(const gfx::Point& anchor_point, |
@@ -41,9 +43,16 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView, |
virtual View* GetContentsView() OVERRIDE; |
virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE; |
+ // WidgetFocusChangeListener overrides: |
+ virtual void NativeFocusWillChange(gfx::NativeView focused_before, |
+ gfx::NativeView focused_now) OVERRIDE; |
+ |
bool close_on_esc() const { return close_on_esc_; } |
void set_close_on_esc(bool close_on_esc) { close_on_esc_ = close_on_esc; } |
+ bool close_on_blur() const { return close_on_blur_; } |
Ben Goodger (Google)
2011/11/01 23:54:56
should be close_on_deactivate
msw
2011/11/05 03:22:24
Done.
|
+ void set_close_on_blur(bool close_on_blur) { close_on_blur_ = close_on_blur; } |
+ |
// Get the arrow's anchor point in screen space. |
virtual gfx::Point GetAnchorPoint(); |
@@ -95,8 +104,9 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView, |
// Fade animation for bubble. |
scoped_ptr<ui::SlideAnimation> fade_animation_; |
- // Should this bubble close on the escape key? |
+ // Flags controlling bubble closure on the escape key and loss of focus. |
bool close_on_esc_; |
+ bool close_on_blur_; |
// The screen point where this bubble's arrow is anchored. |
gfx::Point anchor_point_; |