diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-18 16:40:06 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-18 16:40:06 +0000 |
commit | 8d625fbd16a1d20f5e34bd01b83b0402bd3b4c80 (patch) | |
tree | 4fd429027e6fe44e79e8395ae63d6542d7edf657 /ui | |
parent | 87cc09add3a1a9ef94aaec1865fc3aaa23720aaa (diff) | |
download | chromium_src-8d625fbd16a1d20f5e34bd01b83b0402bd3b4c80.zip chromium_src-8d625fbd16a1d20f5e34bd01b83b0402bd3b4c80.tar.gz chromium_src-8d625fbd16a1d20f5e34bd01b83b0402bd3b4c80.tar.bz2 |
* Use Virtual Screen Coordinates in more places
- When setting widget bounds.
- Workspace Manager
- When resizing
- Restore bounds
* Refactored ScreenPositionClient to manage Screen coordinates for different configurations.
* Renamed GetBounds/SetBounds methods to GetScreen/ParentBounds to make it clear that in which coordinates you're dealing with.
* I used InScreen/InParent for RestoreBounds because RestoreParent/ScreenBounds sounds strange.
Converted Linux/Aura to use ScreenPositionClient.
BUG=123160
TEST=several tests are updated to match VSC. added screen_ash_unittests. I'll update rest of tests when this is enable by default.
Review URL: https://chromiumcodereview.appspot.com/10696023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147250 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/aura/client/screen_position_client.cc | 6 | ||||
-rw-r--r-- | ui/aura/client/screen_position_client.h | 20 | ||||
-rw-r--r-- | ui/aura/window.cc | 35 | ||||
-rw-r--r-- | ui/aura/window.h | 18 | ||||
-rw-r--r-- | ui/aura/window_unittest.cc | 10 | ||||
-rw-r--r-- | ui/oak/oak_aura_window_display.cc | 2 | ||||
-rw-r--r-- | ui/views/controls/button/menu_button.cc | 2 | ||||
-rw-r--r-- | ui/views/widget/desktop_native_widget_helper_aura.cc | 79 | ||||
-rw-r--r-- | ui/views/widget/native_widget_aura.cc | 52 | ||||
-rw-r--r-- | ui/views/widget/native_widget_aura.h | 2 | ||||
-rw-r--r-- | ui/views/widget/native_widget_private.h | 2 | ||||
-rw-r--r-- | ui/views/widget/native_widget_win.cc | 2 | ||||
-rw-r--r-- | ui/views/widget/native_widget_win.h | 2 | ||||
-rw-r--r-- | ui/views/widget/widget.cc | 4 | ||||
-rw-r--r-- | ui/views/widget/widget.h | 4 |
15 files changed, 148 insertions, 92 deletions
diff --git a/ui/aura/client/screen_position_client.cc b/ui/aura/client/screen_position_client.cc index 75175e2..ac13156 100644 --- a/ui/aura/client/screen_position_client.cc +++ b/ui/aura/client/screen_position_client.cc @@ -4,7 +4,7 @@ #include "ui/aura/client/screen_position_client.h" -#include "ui/aura/window.h" +#include "ui/aura/root_window.h" #include "ui/aura/window_property.h" DECLARE_WINDOW_PROPERTY_TYPE(aura::client::ScreenPositionClient*) @@ -16,12 +16,12 @@ DEFINE_LOCAL_WINDOW_PROPERTY_KEY(ScreenPositionClient*, kScreenPositionClientKey, NULL); -void SetScreenPositionClient(Window* window, +void SetScreenPositionClient(RootWindow* window, ScreenPositionClient* client) { window->SetProperty(kScreenPositionClientKey, client); } -ScreenPositionClient* GetScreenPositionClient(Window* window) { +ScreenPositionClient* GetScreenPositionClient(const RootWindow* window) { return window ? window->GetProperty(kScreenPositionClientKey) : NULL; } diff --git a/ui/aura/client/screen_position_client.h b/ui/aura/client/screen_position_client.h index 99f7d86..3384c44 100644 --- a/ui/aura/client/screen_position_client.h +++ b/ui/aura/client/screen_position_client.h @@ -8,9 +8,14 @@ #include "ui/aura/aura_export.h" #include "ui/aura/window.h" +namespace gfx { +class Rect; +} + namespace aura { class Event; +class RootWindow; class Window; namespace client { @@ -19,18 +24,23 @@ namespace client { // RootWindow into system coordinates. class AURA_EXPORT ScreenPositionClient { public: - // Converts the |screen_point| from a given RootWindow's coordinates space + // Converts the |screen_point| from a given |window|'s coordinate space // into screen coordinate space. - virtual void ConvertToScreenPoint(gfx::Point* screen_point) = 0; - + virtual void ConvertPointToScreen(const Window* window, + gfx::Point* point) = 0; + virtual void ConvertPointFromScreen(const Window* window, + gfx::Point* point) = 0; + // Sets the bounds of the window. The implementation is responsible + // for finding out and translating the right coordinates for the |window|. + virtual void SetBounds(Window* window, const gfx::Rect& bounds) = 0; virtual ~ScreenPositionClient() {} }; // Sets/Gets the activation client on the Window. -AURA_EXPORT void SetScreenPositionClient(Window* window, +AURA_EXPORT void SetScreenPositionClient(RootWindow* window, ScreenPositionClient* client); AURA_EXPORT ScreenPositionClient* GetScreenPositionClient( - Window* window); + const RootWindow* window); } // namespace clients } // namespace aura diff --git a/ui/aura/window.cc b/ui/aura/window.cc index 40a70ef..f652c63 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc @@ -16,6 +16,7 @@ #include "base/stringprintf.h" #include "ui/aura/client/capture_client.h" #include "ui/aura/client/event_client.h" +#include "ui/aura/client/screen_position_client.h" #include "ui/aura/client/stacking_client.h" #include "ui/aura/client/visibility_client.h" #include "ui/aura/env.h" @@ -190,6 +191,9 @@ void Window::SetType(client::WindowType type) { // Cannot change type after the window is initialized. DCHECK(!layer()); type_ = type; + if (type_ == client::WINDOW_TYPE_POPUP) { + LOG(ERROR) << "POPUP:"; + } } void Window::SetName(const std::string& name) { @@ -235,7 +239,7 @@ bool Window::IsVisible() const { return visible_ && layer_ && layer_->IsDrawn(); } -gfx::Rect Window::GetBoundsInRootWindow() const { +gfx::Rect Window::GetRootWindowBounds() const { // TODO(beng): There may be a better way to handle this, and the existing code // is likely wrong anyway in a multi-display world, but this will // do for now. @@ -246,6 +250,21 @@ gfx::Rect Window::GetBoundsInRootWindow() const { return gfx::Rect(origin, bounds().size()); } +gfx::Rect Window::GetScreenBounds() const { + gfx::Rect bounds(GetRootWindowBounds()); + const RootWindow* root = GetRootWindow(); + if (root) { + aura::client::ScreenPositionClient* screen_position_client = + aura::client::GetScreenPositionClient(root); + if (screen_position_client) { + gfx::Point origin = bounds.origin(); + screen_position_client->ConvertPointToScreen(root, &origin); + bounds.set_origin(origin); + } + } + return bounds; +} + void Window::SetTransform(const ui::Transform& transform) { RootWindow* root_window = GetRootWindow(); bool contained_mouse = IsVisible() && root_window && @@ -276,6 +295,20 @@ void Window::SetBounds(const gfx::Rect& new_bounds) { SetBoundsInternal(new_bounds); } +void Window::SetScreenBounds(const gfx::Rect& new_bounds_in_screen) { + RootWindow* root = GetRootWindow(); + if (root) { + gfx::Point origin = new_bounds_in_screen.origin(); + aura::client::ScreenPositionClient* screen_position_client = + aura::client::GetScreenPositionClient(root); + screen_position_client->ConvertPointFromScreen( + parent(), &origin); + SetBounds(gfx::Rect(origin, new_bounds_in_screen.size())); + return; + } + SetBounds(new_bounds_in_screen); +} + gfx::Rect Window::GetTargetBounds() const { return layer_->GetTargetBounds(); } diff --git a/ui/aura/window.h b/ui/aura/window.h index c1f98bc..d9bc9b1 100644 --- a/ui/aura/window.h +++ b/ui/aura/window.h @@ -131,12 +131,14 @@ class AURA_EXPORT Window : public ui::LayerDelegate, // whether Show() without a Hide() has been invoked. bool TargetVisibility() const { return visible_; } - // Returns the window's bounds in screen coordinates. In ash, this is - // effectively screen bounds. - // - // TODO(oshima): Fix this to return screen's coordinate for multi-display - // support. - gfx::Rect GetBoundsInRootWindow() const; + // Returns the window's bounds in root window's coordinates. + gfx::Rect GetRootWindowBounds() const; + + // Returns the window's bounds in screen coordinates. + // How the root window's coordinates is mapped to screen's coordinates + // is platform dependent and defined in the implementation of the + // |aura::client::ScreenPositionClient| interface. + gfx::Rect GetScreenBounds() const; virtual void SetTransform(const ui::Transform& transform); @@ -149,6 +151,10 @@ class AURA_EXPORT Window : public ui::LayerDelegate, // LayoutManager may adjust the bounds. void SetBounds(const gfx::Rect& new_bounds); + // Changes the bounds of the window in the screen coordintates. + // If present, the window's parent's LayoutManager may adjust the bounds. + void SetScreenBounds(const gfx::Rect& new_bounds_in_screen_coords); + // Returns the target bounds of the window. If the window's layer is // not animating, it simply returns the current bounds. gfx::Rect GetTargetBounds() const; diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc index d955719..54a2458 100644 --- a/ui/aura/window_unittest.cc +++ b/ui/aura/window_unittest.cc @@ -934,22 +934,22 @@ TEST_F(WindowTest, ReleaseCaptureOnDestroy) { EXPECT_EQ(NULL, aura::client::GetCaptureWindow(root_window())); } -TEST_F(WindowTest, GetBoundsInRootWindow) { +TEST_F(WindowTest, GetRootWindowBounds) { scoped_ptr<Window> viewport(CreateTestWindowWithBounds( gfx::Rect(0, 0, 300, 300), NULL)); scoped_ptr<Window> child(CreateTestWindowWithBounds( gfx::Rect(0, 0, 100, 100), viewport.get())); // Sanity check. - EXPECT_EQ("0,0 100x100", child->GetBoundsInRootWindow().ToString()); + EXPECT_EQ("0,0 100x100", child->GetRootWindowBounds().ToString()); // The |child| window's screen bounds should move along with the |viewport|. viewport->SetBounds(gfx::Rect(-100, -100, 300, 300)); - EXPECT_EQ("-100,-100 100x100", child->GetBoundsInRootWindow().ToString()); + EXPECT_EQ("-100,-100 100x100", child->GetRootWindowBounds().ToString()); // The |child| window is moved to the 0,0 in screen coordinates. - // |GetBoundsInRootWindow()| should return 0,0. + // |GetRootWindowBounds()| should return 0,0. child->SetBounds(gfx::Rect(100, 100, 100, 100)); - EXPECT_EQ("0,0 100x100", child->GetBoundsInRootWindow().ToString()); + EXPECT_EQ("0,0 100x100", child->GetRootWindowBounds().ToString()); } class MouseEnterExitWindowDelegate : public TestWindowDelegate { diff --git a/ui/oak/oak_aura_window_display.cc b/ui/oak/oak_aura_window_display.cc index 68130091..6bffa624 100644 --- a/ui/oak/oak_aura_window_display.cc +++ b/ui/oak/oak_aura_window_display.cc @@ -123,7 +123,7 @@ string16 OakAuraWindowDisplay::GetText(int row, int column_id) { return PropertyWithBounds("Bounds: ", window_->bounds()); case ROW_BOUNDSINROOTWINDOW: return PropertyWithBounds("Bounds in Root Window: ", - window_->GetBoundsInRootWindow()); + window_->GetRootWindowBounds()); case ROW_TRANSFORM: return ASCIIToUTF16("Transform:"); case ROW_PARENT: diff --git a/ui/views/controls/button/menu_button.cc b/ui/views/controls/button/menu_button.cc index 23607f4..a572654 100644 --- a/ui/views/controls/button/menu_button.cc +++ b/ui/views/controls/button/menu_button.cc @@ -266,7 +266,7 @@ int MenuButton::GetMaximumScreenXCoordinate() { return 0; } - gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaBoundsInScreen(); + gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaScreenBounds(); return monitor_bounds.right() - 1; } diff --git a/ui/views/widget/desktop_native_widget_helper_aura.cc b/ui/views/widget/desktop_native_widget_helper_aura.cc index ad68faf..a10cf3e 100644 --- a/ui/views/widget/desktop_native_widget_helper_aura.cc +++ b/ui/views/widget/desktop_native_widget_helper_aura.cc @@ -34,43 +34,54 @@ DEFINE_WINDOW_PROPERTY_KEY( namespace { -// Client that always offsets the passed in point by the RootHost's origin. -class RootWindowScreenPositionClient +// Client that always offsets by the toplevel RootWindow of the passed +// in child NativeWidgetAura. +class DesktopScreenPositionClient : public aura::client::ScreenPositionClient { public: - explicit RootWindowScreenPositionClient(aura::RootWindow* root_window) - : root_window_(root_window) {} - virtual ~RootWindowScreenPositionClient() {} - - // aura::client::ScreenPositionClient: - virtual void ConvertToScreenPoint(gfx::Point* screen_point) OVERRIDE { - gfx::Point origin = root_window_->GetHostOrigin(); - screen_point->Offset(origin.x(), origin.y()); + DesktopScreenPositionClient() {} + virtual ~DesktopScreenPositionClient() {} + + // aura::client::ScreenPositionClient overrides: + virtual void ConvertPointToScreen(const aura::Window* window, + gfx::Point* point) OVERRIDE { + const aura::RootWindow* root_window = window->GetRootWindow(); + aura::Window::ConvertPointToWindow(window, root_window, point); + gfx::Point origin = root_window->GetHostOrigin(); + point->Offset(origin.x(), origin.y()); } - private: - aura::RootWindow* root_window_; -}; + virtual void ConvertPointFromScreen(const aura::Window* window, + gfx::Point* point) OVERRIDE { + const aura::RootWindow* root_window = window->GetRootWindow(); + gfx::Point origin = root_window->GetHostOrigin(); + point->Offset(-origin.x(), -origin.y()); + aura::Window::ConvertPointToWindow(root_window, window, point); + } -// Client that always offsets by the toplevel RootWindow of the passed in child -// NativeWidgetAura. -class EmbeddedWindowScreenPositionClient - : public aura::client::ScreenPositionClient { - public: - explicit EmbeddedWindowScreenPositionClient(NativeWidgetAura* widget) - : widget_(widget) {} - virtual ~EmbeddedWindowScreenPositionClient() {} + virtual void SetBounds(aura::Window* window, + const gfx::Rect& bounds) OVERRIDE { + gfx::Point origin = bounds.origin(); + aura::RootWindow* root = window->GetRootWindow(); + aura::Window::ConvertPointToWindow(window->parent(), root, &origin); - // aura::client::ScreenPositionClient: - virtual void ConvertToScreenPoint(gfx::Point* screen_point) OVERRIDE { - aura::RootWindow* root = - widget_->GetNativeWindow()->GetRootWindow()->GetRootWindow(); - gfx::Point origin = root->GetHostOrigin(); - screen_point->Offset(origin.x(), origin.y()); +#if !defined(OS_WIN) + if (window->type() == aura::client::WINDOW_TYPE_CONTROL) { + window->SetBounds(gfx::Rect(origin, bounds.size())); + return; + } else if (window->type() == aura::client::WINDOW_TYPE_POPUP) { + // The caller expects windows we consider "embedded" to be placed in the + // screen coordinate system. So we need to offset the root window's + // position (which is in screen coordinates) from these bounds. + gfx::Point host_origin = root->GetHostOrigin(); + origin.Offset(-host_origin.x(), -host_origin.y()); + window->SetBounds(gfx::Rect(origin, bounds.size())); + return; + } +#endif // !defined(OS_WIN) + root->SetHostBounds(bounds); + window->SetBounds(gfx::Rect(bounds.size())); } - - private: - NativeWidgetAura* widget_; }; } // namespace @@ -111,8 +122,6 @@ void DesktopNativeWidgetHelperAura::PreInitialize( if (params.type == Widget::InitParams::TYPE_POPUP || params.type == Widget::InitParams::TYPE_BUBBLE) { is_embedded_window_ = true; - position_client_.reset(new EmbeddedWindowScreenPositionClient(widget_)); - aura::client::SetScreenPositionClient(window, position_client_.get()); return; } else if (params.type == Widget::InitParams::TYPE_CONTROL) { return; @@ -170,9 +179,9 @@ void DesktopNativeWidgetHelperAura::PreInitialize( aura::client::SetDispatcherClient(root_window_.get(), new aura::DesktopDispatcherClient); - position_client_.reset( - new RootWindowScreenPositionClient(root_window_.get())); - aura::client::SetScreenPositionClient(window, position_client_.get()); + position_client_.reset(new DesktopScreenPositionClient()); + aura::client::SetScreenPositionClient(root_window_.get(), + position_client_.get()); } void DesktopNativeWidgetHelperAura::PostInitialize() { diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc index dc2f441..cf77b2f 100644 --- a/ui/views/widget/native_widget_aura.cc +++ b/ui/views/widget/native_widget_aura.cc @@ -70,24 +70,10 @@ aura::client::WindowType GetAuraWindowTypeForWidgetType( } } -const gfx::Rect* GetRestoreBounds(aura::Window* window) { - return window->GetProperty(aura::client::kRestoreBoundsKey); -} - void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds) { window->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds)); } -void AdjustScreenBounds(aura::Window* window, gfx::Rect* bounds) { - aura::client::ScreenPositionClient* screen_position_client = - aura::client::GetScreenPositionClient(window); - if (screen_position_client) { - gfx::Point origin = bounds->origin(); - screen_position_client->ConvertToScreenPoint(&origin); - bounds->set_origin(origin); - } -} - } // namespace // Used when SetInactiveRenderingDisabled() is invoked to track when active @@ -362,19 +348,29 @@ InputMethod* NativeWidgetAura::CreateInputMethod() { } void NativeWidgetAura::CenterWindow(const gfx::Size& size) { - gfx::Rect parent_bounds(window_->parent()->GetBoundsInRootWindow()); + gfx::Rect parent_bounds(window_->parent()->GetRootWindowBounds()); // When centering window, we take the intersection of the host and // the parent. We assume the root window represents the visible // rect of a single screen. gfx::Rect work_area = gfx::Screen::GetDisplayNearestWindow(window_).work_area(); + + aura::client::ScreenPositionClient* screen_position_client = + aura::client::GetScreenPositionClient(window_->GetRootWindow()); + if (screen_position_client) { + gfx::Point origin = work_area.origin(); + screen_position_client->ConvertPointFromScreen(window_->parent(), + &origin); + work_area.set_origin(origin); + } + parent_bounds = parent_bounds.Intersect(work_area); // If |window_|'s transient parent's bounds are big enough to fit it, then we // center it with respect to the transient parent. if (window_->transient_parent()) { gfx::Rect transient_parent_rect = window_->transient_parent()-> - GetBoundsInRootWindow().Intersect(work_area); + GetRootWindowBounds().Intersect(work_area); if (transient_parent_rect.height() >= size.height() && transient_parent_rect.width() >= size.width()) parent_bounds = transient_parent_rect; @@ -433,17 +429,13 @@ void NativeWidgetAura::InitModalType(ui::ModalType modal_type) { } gfx::Rect NativeWidgetAura::GetWindowScreenBounds() const { - gfx::Rect bounds = window_->GetBoundsInRootWindow(); - AdjustScreenBounds(window_, &bounds); - return bounds; + return window_->GetScreenBounds(); } gfx::Rect NativeWidgetAura::GetClientAreaScreenBounds() const { // View-to-screen coordinate system transformations depend on this returning // the full window bounds, for example View::ConvertPointToScreen(). - gfx::Rect bounds = window_->GetBoundsInRootWindow(); - AdjustScreenBounds(window_, &bounds); - return bounds; + return window_->GetScreenBounds(); } gfx::Rect NativeWidgetAura::GetRestoredBounds() const { @@ -457,10 +449,16 @@ gfx::Rect NativeWidgetAura::GetRestoredBounds() const { return restore_bounds ? *restore_bounds : window_->bounds(); } -void NativeWidgetAura::SetBounds(const gfx::Rect& in_bounds) { - gfx::Rect bounds = in_bounds; - if (desktop_helper_.get()) - bounds = desktop_helper_->ModifyAndSetBounds(bounds); +void NativeWidgetAura::SetBounds(const gfx::Rect& bounds) { + aura::RootWindow* root = window_->GetRootWindow(); + if (root) { + aura::client::ScreenPositionClient* screen_position_client = + aura::client::GetScreenPositionClient(root); + if (screen_position_client) { + screen_position_client->SetBounds(window_, bounds); + return; + } + } window_->SetBounds(bounds); } @@ -652,7 +650,7 @@ void NativeWidgetAura::FocusNativeView(gfx::NativeView native_view) { window_->GetFocusManager()->SetFocusedWindow(native_view, NULL); } -gfx::Rect NativeWidgetAura::GetWorkAreaBoundsInScreen() const { +gfx::Rect NativeWidgetAura::GetWorkAreaScreenBounds() const { return gfx::Screen::GetDisplayNearestWindow(GetNativeView()).work_area(); } diff --git a/ui/views/widget/native_widget_aura.h b/ui/views/widget/native_widget_aura.h index 240e657..d54c99e 100644 --- a/ui/views/widget/native_widget_aura.h +++ b/ui/views/widget/native_widget_aura.h @@ -117,7 +117,7 @@ class VIEWS_EXPORT NativeWidgetAura : public internal::NativeWidgetPrivate, virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; virtual void ClearNativeFocus() OVERRIDE; virtual void FocusNativeView(gfx::NativeView native_view) OVERRIDE; - virtual gfx::Rect GetWorkAreaBoundsInScreen() const OVERRIDE; + virtual gfx::Rect GetWorkAreaScreenBounds() const OVERRIDE; virtual void SetInactiveRenderingDisabled(bool value) OVERRIDE; virtual Widget::MoveLoopResult RunMoveLoop() OVERRIDE; virtual void EndMoveLoop() OVERRIDE; diff --git a/ui/views/widget/native_widget_private.h b/ui/views/widget/native_widget_private.h index 6f25459..1ae8bd6 100644 --- a/ui/views/widget/native_widget_private.h +++ b/ui/views/widget/native_widget_private.h @@ -208,7 +208,7 @@ class VIEWS_EXPORT NativeWidgetPrivate : public NativeWidget, virtual void SetCursor(gfx::NativeCursor cursor) = 0; virtual void ClearNativeFocus() = 0; virtual void FocusNativeView(gfx::NativeView native_view) = 0; - virtual gfx::Rect GetWorkAreaBoundsInScreen() const = 0; + virtual gfx::Rect GetWorkAreaScreenBounds() const = 0; virtual void SetInactiveRenderingDisabled(bool value) = 0; virtual Widget::MoveLoopResult RunMoveLoop() = 0; virtual void EndMoveLoop() = 0; diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc index 6bb6f40..5af20c6 100644 --- a/ui/views/widget/native_widget_win.cc +++ b/ui/views/widget/native_widget_win.cc @@ -1169,7 +1169,7 @@ void NativeWidgetWin::FocusNativeView(gfx::NativeView native_view) { ::SetFocus(native_view); } -gfx::Rect NativeWidgetWin::GetWorkAreaBoundsInScreen() const { +gfx::Rect NativeWidgetWin::GetWorkAreaScreenBounds() const { return gfx::Screen::GetDisplayNearestWindow(GetNativeView()).work_area(); } diff --git a/ui/views/widget/native_widget_win.h b/ui/views/widget/native_widget_win.h index 08ca047..a45d3bb 100644 --- a/ui/views/widget/native_widget_win.h +++ b/ui/views/widget/native_widget_win.h @@ -256,7 +256,7 @@ class VIEWS_EXPORT NativeWidgetWin : public ui::WindowImpl, virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; virtual void ClearNativeFocus() OVERRIDE; virtual void FocusNativeView(gfx::NativeView native_view) OVERRIDE; - virtual gfx::Rect GetWorkAreaBoundsInScreen() const OVERRIDE; + virtual gfx::Rect GetWorkAreaScreenBounds() const OVERRIDE; virtual void SetInactiveRenderingDisabled(bool value) OVERRIDE; virtual Widget::MoveLoopResult RunMoveLoop() OVERRIDE; virtual void EndMoveLoop() OVERRIDE; diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc index 1dfb8256..e8ab01a 100644 --- a/ui/views/widget/widget.cc +++ b/ui/views/widget/widget.cc @@ -891,8 +891,8 @@ View* Widget::GetChildViewParent() { return GetContentsView() ? GetContentsView() : GetRootView(); } -gfx::Rect Widget::GetWorkAreaBoundsInScreen() const { - return native_widget_->GetWorkAreaBoundsInScreen(); +gfx::Rect Widget::GetWorkAreaScreenBounds() const { + return native_widget_->GetWorkAreaScreenBounds(); } void Widget::OnOwnerClosing() { diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h index f16ea6b..b993108 100644 --- a/ui/views/widget/widget.h +++ b/ui/views/widget/widget.h @@ -615,8 +615,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // with it. TYPE_CONTROL and TYPE_TOOLTIP is not considered top level. bool is_top_level() const { return is_top_level_; } - // Returns the bounds of work area in the screen that Widget belongs to. - gfx::Rect GetWorkAreaBoundsInScreen() const; + // Returns the work are bounds of the screen the Widget belongs to. + gfx::Rect GetWorkAreaScreenBounds() const; // Notification that our owner is closing. // NOTE: this is not invoked for aura as it's currently not needed there. |