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

Unified Diff: views/window/native_window_win.cc

Issue 7075019: Move a bunch of functions from Window onto Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 | « views/window/native_window_win.h ('k') | views/window/window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/window/native_window_win.cc
===================================================================
--- views/window/native_window_win.cc (revision 87016)
+++ views/window/native_window_win.cc (working copy)
@@ -1175,53 +1175,6 @@
kMonitorEdgePadding, 0);
}
-void NativeWindowWin::HideWindow() {
- // We can just call the function implemented by the widget.
- Hide();
-}
-
-void NativeWindowWin::Activate() {
- if (IsMinimized())
- ::ShowWindow(GetNativeView(), SW_RESTORE);
- ::SetWindowPos(GetNativeView(), HWND_TOP, 0, 0, 0, 0,
- SWP_NOSIZE | SWP_NOMOVE);
- SetForegroundWindow(GetNativeView());
-}
-
-void NativeWindowWin::Deactivate() {
- HWND hwnd = ::GetNextWindow(GetNativeView(), GW_HWNDNEXT);
- if (hwnd)
- ::SetForegroundWindow(hwnd);
-}
-
-void NativeWindowWin::Maximize() {
- ExecuteSystemMenuCommand(SC_MAXIMIZE);
-}
-
-void NativeWindowWin::Minimize() {
- ExecuteSystemMenuCommand(SC_MINIMIZE);
-}
-
-void NativeWindowWin::Restore() {
- ExecuteSystemMenuCommand(SC_RESTORE);
-}
-
-bool NativeWindowWin::IsActive() const {
- return is_active_;
-}
-
-bool NativeWindowWin::IsVisible() const {
- return !!::IsWindowVisible(GetNativeView());
-}
-
-bool NativeWindowWin::IsMaximized() const {
- return !!::IsZoomed(GetNativeView());
-}
-
-bool NativeWindowWin::IsMinimized() const {
- return !!::IsIconic(GetNativeView());
-}
-
void NativeWindowWin::SetFullscreen(bool fullscreen) {
if (fullscreen_ == fullscreen)
return; // Nothing to do.
@@ -1283,11 +1236,6 @@
return fullscreen_;
}
-void NativeWindowWin::SetAlwaysOnTop(bool always_on_top) {
- ::SetWindowPos(GetNativeView(), always_on_top ? HWND_TOPMOST : HWND_NOTOPMOST,
- 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
-}
-
void NativeWindowWin::SetUseDragFrame(bool use_drag_frame) {
if (use_drag_frame) {
// Make the frame slightly transparent during the drag operation.
@@ -1316,10 +1264,6 @@
ResetWindowRegion(true);
}
-gfx::NativeWindow NativeWindowWin::GetNativeWindow() const {
- return GetNativeView();
-}
-
bool NativeWindowWin::ShouldUseNativeFrame() const {
return NativeWidgetWin::IsAeroGlassEnabled();
}
@@ -1354,6 +1298,15 @@
}
////////////////////////////////////////////////////////////////////////////////
+// NativeWindowWin, NativeWidgetWin overrides:
+
+bool NativeWindowWin::IsActive() const {
+ // TODO(beng): evaluate whether or not this is needed. NativeWidgetWin checks
+ // active-state with the OS using GetWindowInfo().
+ return is_active_;
+}
+
+////////////////////////////////////////////////////////////////////////////////
// NativeWindowWin, private:
void NativeWindowWin::RestoreEnabledIfNecessary() {
@@ -1456,11 +1409,6 @@
return DefWindowProc(GetNativeView(), WM_NCACTIVATE, active, 0);
}
-void NativeWindowWin::ExecuteSystemMenuCommand(int command) {
- if (command)
- SendMessage(GetNativeView(), WM_SYSCOMMAND, command, 0);
-}
-
////////////////////////////////////////////////////////////////////////////////
// NativeWindow, public:
« no previous file with comments | « views/window/native_window_win.h ('k') | views/window/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698