summaryrefslogtreecommitdiffstats
path: root/views/widget
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 19:05:03 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 19:05:03 +0000
commit4a6ccfae6fc623853692256afc65b8afd7e33107 (patch)
tree908b8cde4844ef57adb58f020cb134e0f82d2f6d /views/widget
parentc933965b0974d3bd8b090b12766520c0878502a0 (diff)
downloadchromium_src-4a6ccfae6fc623853692256afc65b8afd7e33107.zip
chromium_src-4a6ccfae6fc623853692256afc65b8afd7e33107.tar.gz
chromium_src-4a6ccfae6fc623853692256afc65b8afd7e33107.tar.bz2
Migrate more of BrowserFrame's event handling down into WindowWin/WidgetWin and their delegate interfaces.
BUG=72040 TEST=none Review URL: http://codereview.chromium.org/6683007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78062 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r--views/widget/widget_delegate.h21
-rw-r--r--views/widget/widget_gtk.cc2
-rw-r--r--views/widget/widget_win.cc6
3 files changed, 18 insertions, 11 deletions
diff --git a/views/widget/widget_delegate.h b/views/widget/widget_delegate.h
index 71ea6ee..b37c391 100644
--- a/views/widget/widget_delegate.h
+++ b/views/widget/widget_delegate.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -14,15 +14,20 @@ class WidgetDelegate {
public:
virtual ~WidgetDelegate() {}
- // Called with the display changes (color depth or resolution).
- virtual void DisplayChanged() {}
+ // Called whenever the widget is activated or deactivated.
+ // TODO(beng): This should be consolidated with
+ // WindowDelegate::OnWindowActivationChanged().
+ virtual void OnWidgetActivated(bool active) {}
+
+ // Called whenever the widget's position changes.
+ virtual void OnWidgetMove() {}
- // Called when widget active state has changed.
- virtual void IsActiveChanged(bool active) {}
+ // Called with the display changes (color depth or resolution).
+ virtual void OnDisplayChanged() {}
- // Called when the work area (the desktop area minus taskbars,
- // menubars, etc.) changes in size.
- virtual void WorkAreaChanged() {}
+ // Called when the work area (the desktop area minus task bars,
+ // menu bars, etc.) changes in size.
+ virtual void OnWorkAreaChanged() {}
};
} // namespace views
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index ec9ef0c..a33d70f 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -423,7 +423,7 @@ void WidgetGtk::DoDrag(const OSExchangeData& data, int operation) {
void WidgetGtk::IsActiveChanged() {
if (widget_delegate())
- widget_delegate()->IsActiveChanged(IsActive());
+ widget_delegate()->OnWidgetActivated(IsActive());
}
void WidgetGtk::ResetDropTarget() {
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc
index 783c5ca..3be1d70 100644
--- a/views/widget/widget_win.cc
+++ b/views/widget/widget_win.cc
@@ -564,7 +564,7 @@ void WidgetWin::OnDestroy() {
void WidgetWin::OnDisplayChange(UINT bits_per_pixel, CSize screen_size) {
if (widget_delegate())
- widget_delegate()->DisplayChanged();
+ widget_delegate()->OnDisplayChanged();
}
LRESULT WidgetWin::OnDwmCompositionChanged(UINT msg,
@@ -723,10 +723,12 @@ LRESULT WidgetWin::OnMouseWheel(UINT message, WPARAM w_param, LPARAM l_param) {
}
void WidgetWin::OnMove(const CPoint& point) {
+ widget_delegate()->OnWidgetMove();
SetMsgHandled(FALSE);
}
void WidgetWin::OnMoving(UINT param, const LPRECT new_bounds) {
+ widget_delegate()->OnWidgetMove();
}
LRESULT WidgetWin::OnNCActivate(BOOL active) {
@@ -851,7 +853,7 @@ LRESULT WidgetWin::OnSetText(const wchar_t* text) {
void WidgetWin::OnSettingChange(UINT flags, const wchar_t* section) {
if (flags == SPI_SETWORKAREA && widget_delegate())
- widget_delegate()->WorkAreaChanged();
+ widget_delegate()->OnWorkAreaChanged();
SetMsgHandled(FALSE);
}