summaryrefslogtreecommitdiffstats
path: root/ui/aura
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-19 19:17:04 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-19 19:17:04 +0000
commite2f64d101a1e624bf300f598fea6c336db64f4a2 (patch)
tree9cd0c6a963f1152e2a1ec0667df1242a38fb627b /ui/aura
parent7f1a51c32f9c8c5a44118483c1255328d7983fce (diff)
downloadchromium_src-e2f64d101a1e624bf300f598fea6c336db64f4a2.zip
chromium_src-e2f64d101a1e624bf300f598fea6c336db64f4a2.tar.gz
chromium_src-e2f64d101a1e624bf300f598fea6c336db64f4a2.tar.bz2
Rename bounds accessors to be intuitive and consistent
GetClientAreaScreenBounds -> GetClientAreaBoundsInScreen Get/Set ParentBounds -> Get/Set BoundsInParent GetWorkAreaScreenBounds -> GetWorkAreaBoundsInScreen GetClientAreaScreenBounds -> GetClientAreaBoundsInScreen GetWindowScreenBounds -> GetWindowBoundsInScreen GetScreenBounds -> GetBoundsInScreen GetRootWindowBounds -> GetBoundsInRootWindow BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/10795013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147499 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura')
-rw-r--r--ui/aura/window.cc8
-rw-r--r--ui/aura/window.h6
-rw-r--r--ui/aura/window_unittest.cc10
3 files changed, 12 insertions, 12 deletions
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index e960583..7f8dd83 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -236,7 +236,7 @@ bool Window::IsVisible() const {
return visible_ && layer_ && layer_->IsDrawn();
}
-gfx::Rect Window::GetRootWindowBounds() const {
+gfx::Rect Window::GetBoundsInRootWindow() 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.
@@ -247,8 +247,8 @@ gfx::Rect Window::GetRootWindowBounds() const {
return gfx::Rect(origin, bounds().size());
}
-gfx::Rect Window::GetScreenBounds() const {
- gfx::Rect bounds(GetRootWindowBounds());
+gfx::Rect Window::GetBoundsInScreen() const {
+ gfx::Rect bounds(GetBoundsInRootWindow());
const RootWindow* root = GetRootWindow();
if (root) {
aura::client::ScreenPositionClient* screen_position_client =
@@ -292,7 +292,7 @@ void Window::SetBounds(const gfx::Rect& new_bounds) {
SetBoundsInternal(new_bounds);
}
-void Window::SetScreenBounds(const gfx::Rect& new_bounds_in_screen) {
+void Window::SetBoundsInScreen(const gfx::Rect& new_bounds_in_screen) {
RootWindow* root = GetRootWindow();
if (root) {
gfx::Point origin = new_bounds_in_screen.origin();
diff --git a/ui/aura/window.h b/ui/aura/window.h
index d9bc9b1..ede2c71 100644
--- a/ui/aura/window.h
+++ b/ui/aura/window.h
@@ -132,13 +132,13 @@ class AURA_EXPORT Window : public ui::LayerDelegate,
bool TargetVisibility() const { return visible_; }
// Returns the window's bounds in root window's coordinates.
- gfx::Rect GetRootWindowBounds() const;
+ gfx::Rect GetBoundsInRootWindow() 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;
+ gfx::Rect GetBoundsInScreen() const;
virtual void SetTransform(const ui::Transform& transform);
@@ -153,7 +153,7 @@ class AURA_EXPORT Window : public ui::LayerDelegate,
// 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);
+ void SetBoundsInScreen(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.
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index 54a2458..d955719 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, GetRootWindowBounds) {
+TEST_F(WindowTest, GetBoundsInRootWindow) {
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->GetRootWindowBounds().ToString());
+ EXPECT_EQ("0,0 100x100", child->GetBoundsInRootWindow().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->GetRootWindowBounds().ToString());
+ EXPECT_EQ("-100,-100 100x100", child->GetBoundsInRootWindow().ToString());
// The |child| window is moved to the 0,0 in screen coordinates.
- // |GetRootWindowBounds()| should return 0,0.
+ // |GetBoundsInRootWindow()| should return 0,0.
child->SetBounds(gfx::Rect(100, 100, 100, 100));
- EXPECT_EQ("0,0 100x100", child->GetRootWindowBounds().ToString());
+ EXPECT_EQ("0,0 100x100", child->GetBoundsInRootWindow().ToString());
}
class MouseEnterExitWindowDelegate : public TestWindowDelegate {