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

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: Remove the WS_POPUP style for non-modal dialogs. Created 9 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
« no previous file with comments | « no previous file | views/bubble/bubble_delegate.cc » ('j') | no next file with comments »
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 28b1691e213fb9957deb1e698c998bf3d02945a5..eb6df90714021f508575e5a77df1ced443baacb0 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/widget/widget.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 Widget::Observer {
public:
BubbleDelegateView();
BubbleDelegateView(const gfx::Point& anchor_point,
@@ -41,9 +43,17 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
virtual View* GetContentsView() OVERRIDE;
virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE;
+ // Widget::Observer overrides:
+ virtual void OnWidgetActivationChanged(Widget* widget, bool active) 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_deactivate() const { return close_on_deactivate_; }
+ void set_close_on_deactivate(bool close_on_deactivate) {
+ close_on_deactivate_ = close_on_deactivate;
+ }
+
bool allow_bubble_offscreen() const { return allow_bubble_offscreen_; }
void set_allow_bubble_offscreen(bool allow_bubble_offscreen) {
allow_bubble_offscreen_ = allow_bubble_offscreen;
@@ -100,8 +110,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 deactivation.
bool close_on_esc_;
+ bool close_on_deactivate_;
// Whether the bubble is allowed to be displayed offscreen, or if auto
// re-positioning should be performed.
« no previous file with comments | « no previous file | views/bubble/bubble_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698