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

Unified Diff: views/bubble/bubble_delegate.h

Issue 8384020: Close new bubbles on deactivate; disable rendering Chrome inactive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implement WidgetFocusChangeListener instead. Created 9 years, 2 months 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
« no previous file with comments | « no previous file | views/bubble/bubble_delegate.cc » ('j') | views/bubble/bubble_delegate.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | views/bubble/bubble_delegate.cc » ('j') | views/bubble/bubble_delegate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698