summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/views/constrained_window_impl.cc5
-rw-r--r--chrome/browser/views/frame/aero_glass_non_client_view.cc6
-rw-r--r--chrome/browser/views/frame/aero_glass_non_client_view.h1
-rw-r--r--chrome/browser/views/frame/opaque_non_client_view.cc7
-rw-r--r--chrome/browser/views/frame/opaque_non_client_view.h1
-rw-r--r--chrome/views/base_button.h13
-rw-r--r--chrome/views/non_client_view.h7
7 files changed, 34 insertions, 6 deletions
diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc
index e315e5a..d74ac05 100644
--- a/chrome/browser/views/constrained_window_impl.cc
+++ b/chrome/browser/views/constrained_window_impl.cc
@@ -214,6 +214,7 @@ class ConstrainedWindowNonClientView
virtual int NonClientHitTest(const gfx::Point& point);
virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask);
virtual void EnableClose(bool enable);
+ virtual void ResetWindowControls();
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas);
@@ -553,6 +554,10 @@ void ConstrainedWindowNonClientView::EnableClose(bool enable) {
close_button_->SetEnabled(enable);
}
+void ConstrainedWindowNonClientView::ResetWindowControls() {
+ // We have no window controls to reset.
+}
+
////////////////////////////////////////////////////////////////////////////////
// ConstrainedWindowNonClientView, views::View implementation:
diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.cc b/chrome/browser/views/frame/aero_glass_non_client_view.cc
index e48214e..3311c7b 100644
--- a/chrome/browser/views/frame/aero_glass_non_client_view.cc
+++ b/chrome/browser/views/frame/aero_glass_non_client_view.cc
@@ -219,9 +219,15 @@ int AeroGlassNonClientView::NonClientHitTest(const gfx::Point& point) {
void AeroGlassNonClientView::GetWindowMask(const gfx::Size& size,
gfx::Path* window_mask) {
+ // We use the native window region.
}
void AeroGlassNonClientView::EnableClose(bool enable) {
+ // This is handled exclusively by Window.
+}
+
+void AeroGlassNonClientView::ResetWindowControls() {
+ // Our window controls are rendered by the system and do not require reset.
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.h b/chrome/browser/views/frame/aero_glass_non_client_view.h
index f78d8c1..8e3b8bb 100644
--- a/chrome/browser/views/frame/aero_glass_non_client_view.h
+++ b/chrome/browser/views/frame/aero_glass_non_client_view.h
@@ -29,6 +29,7 @@ class AeroGlassNonClientView : public views::NonClientView {
virtual int NonClientHitTest(const gfx::Point& point);
virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask);
virtual void EnableClose(bool enable);
+ virtual void ResetWindowControls();
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas);
diff --git a/chrome/browser/views/frame/opaque_non_client_view.cc b/chrome/browser/views/frame/opaque_non_client_view.cc
index 9c2c174..2033abb 100644
--- a/chrome/browser/views/frame/opaque_non_client_view.cc
+++ b/chrome/browser/views/frame/opaque_non_client_view.cc
@@ -592,6 +592,13 @@ void OpaqueNonClientView::EnableClose(bool enable) {
close_button_->SetEnabled(enable);
}
+void OpaqueNonClientView::ResetWindowControls() {
+ restore_button_->SetState(views::Button::BS_NORMAL);
+ minimize_button_->SetState(views::Button::BS_NORMAL);
+ maximize_button_->SetState(views::Button::BS_NORMAL);
+ // The close button isn't affected by this constraint.
+}
+
///////////////////////////////////////////////////////////////////////////////
// OpaqueNonClientView, views::View overrides:
diff --git a/chrome/browser/views/frame/opaque_non_client_view.h b/chrome/browser/views/frame/opaque_non_client_view.h
index 3063b11..b49e1d6 100644
--- a/chrome/browser/views/frame/opaque_non_client_view.h
+++ b/chrome/browser/views/frame/opaque_non_client_view.h
@@ -54,6 +54,7 @@ class OpaqueNonClientView : public views::NonClientView,
virtual int NonClientHitTest(const gfx::Point& point);
virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask);
virtual void EnableClose(bool enable);
+ virtual void ResetWindowControls();
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas);
diff --git a/chrome/views/base_button.h b/chrome/views/base_button.h
index d8ab7bf..b943f9f 100644
--- a/chrome/views/base_button.h
+++ b/chrome/views/base_button.h
@@ -121,6 +121,13 @@ class BaseButton : public View,
return state_;
}
+ //
+ // Set the state. If the state is different, causes the button
+ // to be repainted
+ //
+ virtual void SetState(ButtonState new_state);
+
+
virtual void Paint(ChromeCanvas* canvas);
// Variant of paint that allows you to specify whether the paint is for a
@@ -135,12 +142,6 @@ class BaseButton : public View,
// This implementation returns true if the left mouse button is down.
virtual bool IsTriggerableEvent(const MouseEvent& e);
- //
- // Set the state. If the state is different, causes the button
- // to be repainted
- //
- virtual void SetState(ButtonState new_state);
-
virtual void OnDragDone();
// Overriden to reset the state to normal (as long as we're not disabled).
diff --git a/chrome/views/non_client_view.h b/chrome/views/non_client_view.h
index 808227e..d8de9ea 100644
--- a/chrome/views/non_client_view.h
+++ b/chrome/views/non_client_view.h
@@ -54,6 +54,13 @@ class NonClientView : public View {
// the system menu).
virtual void EnableClose(bool enable) = 0;
+ // Tells the window controls as rendered by the NonClientView to reset
+ // themselves to a normal state. This happens in situations where the
+ // containing window does not receive a normal sequences of messages that
+ // would lead to the controls returning to this normal state naturally, e.g.
+ // when the window is maximized, minimized or restored.
+ virtual void ResetWindowControls() = 0;
+
// Prevents the non-client view from rendering as inactive when called with
// |disable| true, until called with false.
void set_paint_as_active(bool paint_as_active) {