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

Side by Side Diff: ui/views/widget/native_widget_win.cc

Issue 10795013: Rename bounds accessors to be intuitive and consistent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/native_widget_win.h ('k') | ui/views/widget/widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/widget/native_widget_win.h" 5 #include "ui/views/widget/native_widget_win.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 // We implement modality by crawling up the hierarchy of windows starting 794 // We implement modality by crawling up the hierarchy of windows starting
795 // at the owner, disabling all of them so that they don't receive input 795 // at the owner, disabling all of them so that they don't receive input
796 // messages. 796 // messages.
797 HWND start = ::GetWindow(GetNativeView(), GW_OWNER); 797 HWND start = ::GetWindow(GetNativeView(), GW_OWNER);
798 while (start) { 798 while (start) {
799 ::EnableWindow(start, FALSE); 799 ::EnableWindow(start, FALSE);
800 start = ::GetParent(start); 800 start = ::GetParent(start);
801 } 801 }
802 } 802 }
803 803
804 gfx::Rect NativeWidgetWin::GetWindowScreenBounds() const { 804 gfx::Rect NativeWidgetWin::GetWindowBoundsInScreen() const {
805 RECT r; 805 RECT r;
806 GetWindowRect(&r); 806 GetWindowRect(&r);
807 return gfx::Rect(r); 807 return gfx::Rect(r);
808 } 808 }
809 809
810 gfx::Rect NativeWidgetWin::GetClientAreaScreenBounds() const { 810 gfx::Rect NativeWidgetWin::GetClientAreaBoundsInScreen() const {
811 RECT r; 811 RECT r;
812 GetClientRect(&r); 812 GetClientRect(&r);
813 POINT point = { r.left, r.top }; 813 POINT point = { r.left, r.top };
814 ClientToScreen(hwnd(), &point); 814 ClientToScreen(hwnd(), &point);
815 return gfx::Rect(point.x, point.y, r.right - r.left, r.bottom - r.top); 815 return gfx::Rect(point.x, point.y, r.right - r.left, r.bottom - r.top);
816 } 816 }
817 817
818 gfx::Rect NativeWidgetWin::GetRestoredBounds() const { 818 gfx::Rect NativeWidgetWin::GetRestoredBounds() const {
819 // If we're in fullscreen mode, we've changed the normal bounds to the monitor 819 // If we're in fullscreen mode, we've changed the normal bounds to the monitor
820 // rect, so return the saved bounds instead. 820 // rect, so return the saved bounds instead.
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 void NativeWidgetWin::ClearNativeFocus() { 1162 void NativeWidgetWin::ClearNativeFocus() {
1163 ::SetFocus(GetNativeView()); 1163 ::SetFocus(GetNativeView());
1164 } 1164 }
1165 1165
1166 void NativeWidgetWin::FocusNativeView(gfx::NativeView native_view) { 1166 void NativeWidgetWin::FocusNativeView(gfx::NativeView native_view) {
1167 // Only reset focus if hwnd is not already focused. 1167 // Only reset focus if hwnd is not already focused.
1168 if (native_view && ::GetFocus() != native_view) 1168 if (native_view && ::GetFocus() != native_view)
1169 ::SetFocus(native_view); 1169 ::SetFocus(native_view);
1170 } 1170 }
1171 1171
1172 gfx::Rect NativeWidgetWin::GetWorkAreaScreenBounds() const { 1172 gfx::Rect NativeWidgetWin::GetWorkAreaBoundsInScreen() const {
1173 return gfx::Screen::GetDisplayNearestWindow(GetNativeView()).work_area(); 1173 return gfx::Screen::GetDisplayNearestWindow(GetNativeView()).work_area();
1174 } 1174 }
1175 1175
1176 void NativeWidgetWin::SetInactiveRenderingDisabled(bool value) { 1176 void NativeWidgetWin::SetInactiveRenderingDisabled(bool value) {
1177 } 1177 }
1178 1178
1179 Widget::MoveLoopResult NativeWidgetWin::RunMoveLoop() { 1179 Widget::MoveLoopResult NativeWidgetWin::RunMoveLoop() {
1180 ReleaseCapture(); 1180 ReleaseCapture();
1181 MoveLoopMouseWatcher watcher(this); 1181 MoveLoopMouseWatcher watcher(this);
1182 SendMessage(hwnd(), WM_SYSCOMMAND, SC_MOVE | 0x0002, GetMessagePos()); 1182 SendMessage(hwnd(), WM_SYSCOMMAND, SC_MOVE | 0x0002, GetMessagePos());
(...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after
2767 // static 2767 // static
2768 bool NativeWidgetPrivate::IsTouchDown() { 2768 bool NativeWidgetPrivate::IsTouchDown() {
2769 // This currently isn't necessary because we're not generating touch events on 2769 // This currently isn't necessary because we're not generating touch events on
2770 // windows. When we do, this will need to be updated. 2770 // windows. When we do, this will need to be updated.
2771 return false; 2771 return false;
2772 } 2772 }
2773 2773
2774 } // namespace internal 2774 } // namespace internal
2775 2775
2776 } // namespace views 2776 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_win.h ('k') | ui/views/widget/widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698