summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-24 21:46:27 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-24 21:46:27 +0000
commita1f52889a7eb791892e55fe6fd6e8567b6842ca1 (patch)
tree18113f598b8029063ea74ded6c169bd9c84e99f3 /ui
parent708809d424160060face97bac3cf00f31d607495 (diff)
downloadchromium_src-a1f52889a7eb791892e55fe6fd6e8567b6842ca1.zip
chromium_src-a1f52889a7eb791892e55fe6fd6e8567b6842ca1.tar.gz
chromium_src-a1f52889a7eb791892e55fe6fd6e8567b6842ca1.tar.bz2
Move a few more easy things from NWW to HWNDMessageHandler.
http://crbug.com/142962 TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/10873046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153301 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/views/widget/native_widget_win.cc138
-rw-r--r--ui/views/widget/native_widget_win.h6
-rw-r--r--ui/views/win/hwnd_message_handler.cc178
-rw-r--r--ui/views/win/hwnd_message_handler.h38
4 files changed, 237 insertions, 123 deletions
diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc
index 2f54273..4dbec78 100644
--- a/ui/views/widget/native_widget_win.cc
+++ b/ui/views/widget/native_widget_win.cc
@@ -279,21 +279,6 @@ const char* const kNativeWidgetKey = "__VIEWS_NATIVE_WIDGET__";
const int kDragFrameWindowAlpha = 200;
-struct FindOwnedWindowsData {
- HWND window;
- std::vector<Widget*> owned_widgets;
-};
-
-BOOL CALLBACK FindOwnedWindowsCallback(HWND hwnd, LPARAM param) {
- FindOwnedWindowsData* data = reinterpret_cast<FindOwnedWindowsData*>(param);
- if (GetWindow(hwnd, GW_OWNER) == data->window) {
- Widget* widget = Widget::GetWidgetForNativeView(hwnd);
- if (widget)
- data->owned_widgets.push_back(widget);
- }
- return TRUE;
-}
-
} // namespace
// static
@@ -622,30 +607,15 @@ void NativeWidgetWin::SetAccessibleState(ui::AccessibilityTypes::State state) {
}
void NativeWidgetWin::InitModalType(ui::ModalType modal_type) {
- if (modal_type == ui::MODAL_TYPE_NONE)
- return;
- // We implement modality by crawling up the hierarchy of windows starting
- // at the owner, disabling all of them so that they don't receive input
- // messages.
- HWND start = ::GetWindow(GetNativeView(), GW_OWNER);
- while (start) {
- ::EnableWindow(start, FALSE);
- start = ::GetParent(start);
- }
+ message_handler_->InitModalType(modal_type);
}
gfx::Rect NativeWidgetWin::GetWindowBoundsInScreen() const {
- RECT r;
- GetWindowRect(&r);
- return gfx::Rect(r);
+ return message_handler_->GetWindowBoundsInScreen();
}
gfx::Rect NativeWidgetWin::GetClientAreaBoundsInScreen() const {
- RECT r;
- GetClientRect(&r);
- POINT point = { r.left, r.top };
- ClientToScreen(hwnd(), &point);
- return gfx::Rect(point.x, point.y, r.right - r.left, r.bottom - r.top);
+ return message_handler_->GetClientAreaBoundsInScreen();
}
gfx::Rect NativeWidgetWin::GetRestoredBounds() const {
@@ -653,26 +623,19 @@ gfx::Rect NativeWidgetWin::GetRestoredBounds() const {
}
void NativeWidgetWin::SetBounds(const gfx::Rect& bounds) {
- LONG style = GetWindowLong(GWL_STYLE);
- if (style & WS_MAXIMIZE)
- SetWindowLong(GWL_STYLE, style & ~WS_MAXIMIZE);
- SetWindowPos(NULL, bounds.x(), bounds.y(), bounds.width(), bounds.height(),
- SWP_NOACTIVATE | SWP_NOZORDER);
+ message_handler_->SetBounds(bounds);
}
void NativeWidgetWin::SetSize(const gfx::Size& size) {
- SetWindowPos(NULL, 0, 0, size.width(), size.height(),
- SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE);
+ message_handler_->SetSize(size);
}
void NativeWidgetWin::StackAbove(gfx::NativeView native_view) {
- SetWindowPos(native_view, 0, 0, 0, 0,
- SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+ message_handler_->StackAbove(native_view);
}
void NativeWidgetWin::StackAtTop() {
- SetWindowPos(HWND_TOP, 0, 0, 0, 0,
- SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+ message_handler_->StackAtTop();
}
void NativeWidgetWin::StackBelow(gfx::NativeView native_view) {
@@ -680,7 +643,7 @@ void NativeWidgetWin::StackBelow(gfx::NativeView native_view) {
}
void NativeWidgetWin::SetShape(gfx::NativeRegion region) {
- SetWindowRgn(region, TRUE);
+ message_handler_->SetRegion(region);
}
void NativeWidgetWin::Close() {
@@ -707,12 +670,7 @@ void NativeWidgetWin::Close() {
}
void NativeWidgetWin::CloseNow() {
- // We may already have been destroyed if the selection resulted in a tab
- // switch which will have reactivated the browser window and closed us, so
- // we need to check to see if we're still a window before trying to destroy
- // ourself.
- if (IsWindow())
- DestroyWindow(hwnd());
+ message_handler_->CloseNow();
}
void NativeWidgetWin::Show() {
@@ -724,27 +682,12 @@ void NativeWidgetWin::Show() {
}
void NativeWidgetWin::Hide() {
- if (IsWindow()) {
- // NOTE: Be careful not to activate any windows here (for example, calling
- // ShowWindow(SW_HIDE) will automatically activate another window). This
- // code can be called while a window is being deactivated, and activating
- // another window will screw up the activation that is already in progress.
- SetWindowPos(NULL, 0, 0, 0, 0,
- SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE |
- SWP_NOREPOSITION | SWP_NOSIZE | SWP_NOZORDER);
-
- if (!GetParent())
- NotifyOwnedWindowsParentClosing();
- }
+ message_handler_->Hide();
}
void NativeWidgetWin::ShowMaximizedWithBounds(
const gfx::Rect& restored_bounds) {
- WINDOWPLACEMENT placement = { 0 };
- placement.length = sizeof(WINDOWPLACEMENT);
- placement.showCmd = SW_SHOWMAXIMIZED;
- placement.rcNormalPosition = restored_bounds.ToRECT();
- SetWindowPlacement(hwnd(), &placement);
+ message_handler_->ShowMaximizedWithBounds(restored_bounds);
}
void NativeWidgetWin::ShowWithWindowState(ui::WindowShowState show_state) {
@@ -771,17 +714,11 @@ bool NativeWidgetWin::IsVisible() const {
}
void NativeWidgetWin::Activate() {
- if (IsMinimized())
- ::ShowWindow(GetNativeView(), SW_RESTORE);
- ::SetWindowPos(GetNativeView(), HWND_TOP, 0, 0, 0, 0,
- SWP_NOSIZE | SWP_NOMOVE);
- SetForegroundWindow(GetNativeView());
+ message_handler_->Activate();
}
void NativeWidgetWin::Deactivate() {
- HWND hwnd = ::GetNextWindow(GetNativeView(), GW_HWNDNEXT);
- if (hwnd)
- ::SetForegroundWindow(hwnd);
+ message_handler_->Deactivate();
}
bool NativeWidgetWin::IsActive() const {
@@ -789,18 +726,15 @@ bool NativeWidgetWin::IsActive() const {
}
void NativeWidgetWin::SetAlwaysOnTop(bool on_top) {
- ::SetWindowPos(GetNativeView(), on_top ? HWND_TOPMOST : HWND_NOTOPMOST,
- 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ message_handler_->SetAlwaysOnTop(on_top);
}
void NativeWidgetWin::Maximize() {
- ExecuteSystemMenuCommand(SC_MAXIMIZE);
+ message_handler_->Maximize();
}
void NativeWidgetWin::Minimize() {
- ExecuteSystemMenuCommand(SC_MINIMIZE);
-
- delegate_->OnNativeBlur(NULL);
+ message_handler_->Minimize();
}
bool NativeWidgetWin::IsMaximized() const {
@@ -812,7 +746,7 @@ bool NativeWidgetWin::IsMinimized() const {
}
void NativeWidgetWin::Restore() {
- ExecuteSystemMenuCommand(SC_RESTORE);
+ message_handler_->Restore();
}
void NativeWidgetWin::SetFullscreen(bool fullscreen) {
@@ -855,17 +789,7 @@ void NativeWidgetWin::SetUseDragFrame(bool use_drag_frame) {
}
void NativeWidgetWin::FlashFrame(bool flash) {
- FLASHWINFO fwi;
- fwi.cbSize = sizeof(fwi);
- fwi.hwnd = hwnd();
- if (flash) {
- fwi.dwFlags = FLASHW_ALL;
- fwi.uCount = 4;
- fwi.dwTimeout = 0;
- } else {
- fwi.dwFlags = FLASHW_STOP;
- }
- FlashWindowEx(&fwi);
+ message_handler_->FlashFrame(flash);
}
bool NativeWidgetWin::IsAccessibleWidget() const {
@@ -913,13 +837,11 @@ void NativeWidgetWin::SetCursor(gfx::NativeCursor cursor) {
}
void NativeWidgetWin::ClearNativeFocus() {
- ::SetFocus(GetNativeView());
+ message_handler_->ClearNativeFocus();
}
void NativeWidgetWin::FocusNativeView(gfx::NativeView native_view) {
- // Only reset focus if hwnd is not already focused.
- if (native_view && ::GetFocus() != native_view)
- ::SetFocus(native_view);
+ message_handler_->FocusHWND(native_view);
}
gfx::Rect NativeWidgetWin::GetWorkAreaBoundsInScreen() const {
@@ -946,11 +868,7 @@ void NativeWidgetWin::EndMoveLoop() {
}
void NativeWidgetWin::SetVisibilityChangedAnimationsEnabled(bool value) {
- if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
- int dwm_value = value ? FALSE : TRUE;
- DwmSetWindowAttribute(
- hwnd(), DWMWA_TRANSITIONS_FORCEDISABLED, &dwm_value, sizeof(dwm_value));
- }
+ message_handler_->SetVisibilityChangedAnimationsEnabled(value);
}
////////////////////////////////////////////////////////////////////////////////
@@ -1376,11 +1294,6 @@ void NativeWidgetWin::SetInitialFocus() {
}
}
-void NativeWidgetWin::ExecuteSystemMenuCommand(int command) {
- if (command)
- SendMessage(GetNativeView(), WM_SYSCOMMAND, command, 0);
-}
-
////////////////////////////////////////////////////////////////////////////////
// NativeWidgetWin, HWNDMessageHandlerDelegate implementation:
@@ -1801,15 +1714,6 @@ void NativeWidgetWin::RestoreEnabledIfNecessary() {
}
}
-void NativeWidgetWin::NotifyOwnedWindowsParentClosing() {
- FindOwnedWindowsData data;
- data.window = hwnd();
- EnumThreadWindows(GetCurrentThreadId(), FindOwnedWindowsCallback,
- reinterpret_cast<LPARAM>(&data));
- for (size_t i = 0; i < data.owned_widgets.size(); ++i)
- data.owned_widgets[i]->OnOwnerClosing();
-}
-
////////////////////////////////////////////////////////////////////////////////
// Widget, public:
diff --git a/ui/views/widget/native_widget_win.h b/ui/views/widget/native_widget_win.h
index a728a2c..d6ed0ee 100644
--- a/ui/views/widget/native_widget_win.h
+++ b/ui/views/widget/native_widget_win.h
@@ -437,9 +437,6 @@ class VIEWS_EXPORT NativeWidgetWin : public ui::WindowImpl,
// Called when a MSAA screen reader client is detected.
virtual void OnScreenReaderDetected();
- // Executes the specified SC_command.
- void ExecuteSystemMenuCommand(int command);
-
// The TooltipManager. This is NULL if there is a problem creating the
// underlying tooltip window.
// WARNING: RootView's destructor calls into the TooltipManager. As such, this
@@ -526,9 +523,6 @@ class VIEWS_EXPORT NativeWidgetWin : public ui::WindowImpl,
void SetInitialFocus();
- // Notifies any owned windows that we're closing.
- void NotifyOwnedWindowsParentClosing();
-
// A delegate implementation that handles events received here.
// See class documentation for Widget in widget.h for a note about ownership.
internal::NativeWidgetDelegate* delegate_;
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index fa28e3c..762e254 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -63,6 +63,21 @@ bool GetMonitorAndRects(const RECT& rect,
return true;
}
+struct FindOwnedWindowsData {
+ HWND window;
+ std::vector<Widget*> owned_widgets;
+};
+
+BOOL CALLBACK FindOwnedWindowsCallback(HWND hwnd, LPARAM param) {
+ FindOwnedWindowsData* data = reinterpret_cast<FindOwnedWindowsData*>(param);
+ if (GetWindow(hwnd, GW_OWNER) == data->window) {
+ Widget* widget = Widget::GetWidgetForNativeView(hwnd);
+ if (widget)
+ data->owned_widgets.push_back(widget);
+ }
+ return TRUE;
+}
+
// A custom MSAA object id used to determine if a screen reader is actively
// listening for MSAA events.
const int kCustomObjectID = 1;
@@ -99,6 +114,43 @@ void HWNDMessageHandler::Init(const gfx::Rect& bounds) {
&last_work_area_);
}
+void HWNDMessageHandler::InitModalType(ui::ModalType modal_type) {
+ if (modal_type == ui::MODAL_TYPE_NONE)
+ return;
+ // We implement modality by crawling up the hierarchy of windows starting
+ // at the owner, disabling all of them so that they don't receive input
+ // messages.
+ HWND start = ::GetWindow(hwnd(), GW_OWNER);
+ while (start) {
+ ::EnableWindow(start, FALSE);
+ start = ::GetParent(start);
+ }
+}
+
+void HWNDMessageHandler::CloseNow() {
+ // We may already have been destroyed if the selection resulted in a tab
+ // switch which will have reactivated the browser window and closed us, so
+ // we need to check to see if we're still a window before trying to destroy
+ // ourself.
+ if (IsWindow(hwnd()))
+ DestroyWindow(hwnd());
+}
+
+gfx::Rect HWNDMessageHandler::GetWindowBoundsInScreen() const {
+ RECT r;
+ GetWindowRect(hwnd(), &r);
+ return gfx::Rect(r);
+}
+
+gfx::Rect HWNDMessageHandler::GetClientAreaBoundsInScreen() const {
+ RECT r;
+ GetClientRect(hwnd(), &r);
+ POINT point = { r.left, r.top };
+ ClientToScreen(hwnd(), &point);
+ return gfx::Rect(point.x, point.y, r.right - r.left, r.bottom - r.top);
+}
+
+
gfx::Rect HWNDMessageHandler::GetRestoredBounds() const {
// If we're in fullscreen mode, we've changed the normal bounds to the monitor
// rect, so return the saved bounds instead.
@@ -140,6 +192,86 @@ void HWNDMessageHandler::GetWindowPlacement(
}
}
+void HWNDMessageHandler::SetBounds(const gfx::Rect& bounds) {
+ LONG style = GetWindowLong(hwnd(), GWL_STYLE);
+ if (style & WS_MAXIMIZE)
+ SetWindowLong(hwnd(), GWL_STYLE, style & ~WS_MAXIMIZE);
+ SetWindowPos(hwnd(), NULL, bounds.x(), bounds.y(), bounds.width(),
+ bounds.height(), SWP_NOACTIVATE | SWP_NOZORDER);
+}
+
+void HWNDMessageHandler::SetSize(const gfx::Size& size) {
+ SetWindowPos(hwnd(), NULL, 0, 0, size.width(), size.height(),
+ SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE);
+}
+
+void HWNDMessageHandler::SetRegion(HRGN region) {
+ SetWindowRgn(hwnd(), region, TRUE);
+}
+
+void HWNDMessageHandler::StackAbove(HWND other_hwnd) {
+ SetWindowPos(hwnd(), other_hwnd, 0, 0, 0, 0,
+ SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+}
+
+void HWNDMessageHandler::StackAtTop() {
+ SetWindowPos(hwnd(), HWND_TOP, 0, 0, 0, 0,
+ SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+}
+
+void HWNDMessageHandler::ShowMaximizedWithBounds(const gfx::Rect& bounds) {
+ WINDOWPLACEMENT placement = { 0 };
+ placement.length = sizeof(WINDOWPLACEMENT);
+ placement.showCmd = SW_SHOWMAXIMIZED;
+ placement.rcNormalPosition = bounds.ToRECT();
+ SetWindowPlacement(hwnd(), &placement);
+}
+
+void HWNDMessageHandler::Hide() {
+ if (IsWindow(hwnd())) {
+ // NOTE: Be careful not to activate any windows here (for example, calling
+ // ShowWindow(SW_HIDE) will automatically activate another window). This
+ // code can be called while a window is being deactivated, and activating
+ // another window will screw up the activation that is already in progress.
+ SetWindowPos(hwnd(), NULL, 0, 0, 0, 0,
+ SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE |
+ SWP_NOREPOSITION | SWP_NOSIZE | SWP_NOZORDER);
+
+ if (!GetParent(hwnd()))
+ NotifyOwnedWindowsParentClosing();
+ }
+}
+
+void HWNDMessageHandler::Maximize() {
+ ExecuteSystemMenuCommand(SC_MAXIMIZE);
+}
+
+void HWNDMessageHandler::Minimize() {
+ ExecuteSystemMenuCommand(SC_MINIMIZE);
+ delegate_->HandleNativeBlur(NULL);
+}
+
+void HWNDMessageHandler::Restore() {
+ ExecuteSystemMenuCommand(SC_RESTORE);
+}
+
+void HWNDMessageHandler::Activate() {
+ if (IsMinimized())
+ ::ShowWindow(hwnd(), SW_RESTORE);
+ ::SetWindowPos(hwnd(), HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
+ SetForegroundWindow(hwnd());
+}
+
+void HWNDMessageHandler::Deactivate() {
+ HWND next_hwnd = ::GetNextWindow(hwnd(), GW_HWNDNEXT);
+ if (next_hwnd)
+ ::SetForegroundWindow(next_hwnd);
+}
+
+void HWNDMessageHandler::SetAlwaysOnTop(bool on_top) {
+ ::SetWindowPos(hwnd(), on_top ? HWND_TOPMOST : HWND_NOTOPMOST,
+ 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+}
bool HWNDMessageHandler::IsVisible() const {
return !!::IsWindowVisible(hwnd());
@@ -164,6 +296,30 @@ void HWNDMessageHandler::SendFrameChanged() {
SWP_NOSENDCHANGING | SWP_NOSIZE | SWP_NOZORDER);
}
+void HWNDMessageHandler::FlashFrame(bool flash) {
+ FLASHWINFO fwi;
+ fwi.cbSize = sizeof(fwi);
+ fwi.hwnd = hwnd();
+ if (flash) {
+ fwi.dwFlags = FLASHW_ALL;
+ fwi.uCount = 4;
+ fwi.dwTimeout = 0;
+ } else {
+ fwi.dwFlags = FLASHW_STOP;
+ }
+ FlashWindowEx(&fwi);
+}
+
+void HWNDMessageHandler::ClearNativeFocus() {
+ ::SetFocus(hwnd());
+}
+
+void HWNDMessageHandler::FocusHWND(HWND hwnd) {
+ // Only reset focus if hwnd is not already focused.
+ if (hwnd && ::GetFocus() != hwnd)
+ ::SetFocus(hwnd);
+}
+
void HWNDMessageHandler::SetCapture() {
DCHECK(!HasCapture());
::SetCapture(hwnd());
@@ -177,6 +333,14 @@ bool HWNDMessageHandler::HasCapture() const {
return ::GetCapture() == hwnd();
}
+void HWNDMessageHandler::SetVisibilityChangedAnimationsEnabled(bool enabled) {
+ if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
+ int dwm_value = enabled ? FALSE : TRUE;
+ DwmSetWindowAttribute(
+ hwnd(), DWMWA_TRANSITIONS_FORCEDISABLED, &dwm_value, sizeof(dwm_value));
+ }
+}
+
InputMethod* HWNDMessageHandler::CreateInputMethod() {
#if !defined(USE_AURA)
CommandLine* command_line = CommandLine::ForCurrentProcess();
@@ -1041,6 +1205,11 @@ void HWNDMessageHandler::DispatchKeyEventPostIME(const ui::KeyEvent& key) {
////////////////////////////////////////////////////////////////////////////////
// HWNDMessageHandler, private:
+void HWNDMessageHandler::ExecuteSystemMenuCommand(int command) {
+ if (command)
+ SendMessage(hwnd(), WM_SYSCOMMAND, command, 0);
+}
+
void HWNDMessageHandler::TrackMouseEvents(DWORD mouse_tracking_flags) {
// Begin tracking mouse events for this HWND so that we get WM_MOUSELEAVE
// when the user moves the mouse outside this HWND's bounds.
@@ -1199,6 +1368,15 @@ LRESULT HWNDMessageHandler::DefWindowProcWithRedrawLock(UINT message,
return result;
}
+void HWNDMessageHandler::NotifyOwnedWindowsParentClosing() {
+ FindOwnedWindowsData data;
+ data.window = hwnd();
+ EnumThreadWindows(GetCurrentThreadId(), FindOwnedWindowsCallback,
+ reinterpret_cast<LPARAM>(&data));
+ for (size_t i = 0; i < data.owned_widgets.size(); ++i)
+ data.owned_widgets[i]->OnOwnerClosing();
+}
+
void HWNDMessageHandler::LockUpdates(bool force) {
// We skip locked updates when Aero is on for two reasons:
// 1. Because it isn't necessary
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
index 5bf9728..efc3367 100644
--- a/ui/views/win/hwnd_message_handler.h
+++ b/ui/views/win/hwnd_message_handler.h
@@ -45,11 +45,36 @@ class VIEWS_EXPORT HWNDMessageHandler : public internal::InputMethodDelegate {
~HWNDMessageHandler();
void Init(const gfx::Rect& bounds);
+ void InitModalType(ui::ModalType modal_type);
+ void CloseNow();
+
+ gfx::Rect GetWindowBoundsInScreen() const;
+ gfx::Rect GetClientAreaBoundsInScreen() const;
gfx::Rect GetRestoredBounds() const;
void GetWindowPlacement(gfx::Rect* bounds,
ui::WindowShowState* show_state) const;
+ void SetBounds(const gfx::Rect& bounds);
+ void SetSize(const gfx::Size& size);
+
+ void SetRegion(HRGN rgn);
+
+ void StackAbove(HWND other_hwnd);
+ void StackAtTop();
+
+ void ShowMaximizedWithBounds(const gfx::Rect& bounds);
+ void Hide();
+
+ void Maximize();
+ void Minimize();
+ void Restore();
+
+ void Activate();
+ void Deactivate();
+
+ void SetAlwaysOnTop(bool on_top);
+
bool IsVisible() const;
bool IsActive() const;
bool IsMinimized() const;
@@ -58,12 +83,19 @@ class VIEWS_EXPORT HWNDMessageHandler : public internal::InputMethodDelegate {
// Tells the HWND its client area has changed.
void SendFrameChanged();
+ void FlashFrame(bool flash);
+
+ void ClearNativeFocus();
+ void FocusHWND(HWND hwnd);
+
void SetCapture();
void ReleaseCapture();
bool HasCapture() const;
FullscreenHandler* fullscreen_handler() { return fullscreen_handler_.get(); }
+ void SetVisibilityChangedAnimationsEnabled(bool enabled);
+
InputMethod* CreateInputMethod();
// Message Handlers.
@@ -141,6 +173,9 @@ class VIEWS_EXPORT HWNDMessageHandler : public internal::InputMethodDelegate {
// Overridden from internal::InputMethodDelegate
virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) OVERRIDE;
+ // Executes the specified SC_command.
+ void ExecuteSystemMenuCommand(int command);
+
// Start tracking all mouse events so that this window gets sent mouse leave
// messages too.
void TrackMouseEvents(DWORD mouse_tracking_flags);
@@ -160,6 +195,9 @@ class VIEWS_EXPORT HWNDMessageHandler : public internal::InputMethodDelegate {
WPARAM w_param,
LPARAM l_param);
+ // Notifies any owned windows that we're closing.
+ void NotifyOwnedWindowsParentClosing();
+
// Lock or unlock the window from being able to redraw itself in response to
// updates to its invalid region.
class ScopedRedrawLock;