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

Side by Side Diff: ash/screen_ash.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 | « ash/screen_ash.h ('k') | ash/screen_ash_unittest.cc » ('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 "ash/screen_ash.h" 5 #include "ash/screen_ash.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm/shelf_layout_manager.h" 8 #include "ash/wm/shelf_layout_manager.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/aura/client/screen_position_client.h" 10 #include "ui/aura/client/screen_position_client.h"
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 } // namespace 23 } // namespace
24 24
25 ScreenAsh::ScreenAsh() { 25 ScreenAsh::ScreenAsh() {
26 } 26 }
27 27
28 ScreenAsh::~ScreenAsh() { 28 ScreenAsh::~ScreenAsh() {
29 } 29 }
30 30
31 // static 31 // static
32 gfx::Rect ScreenAsh::GetMaximizedWindowParentBounds(aura::Window* window) { 32 gfx::Rect ScreenAsh::GetMaximizedWindowBoundsInParent(aura::Window* window) {
33 if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) 33 if (window->GetRootWindow() == Shell::GetPrimaryRootWindow())
34 return Shell::GetInstance()->shelf()->GetMaximizedWindowBounds(window); 34 return Shell::GetInstance()->shelf()->GetMaximizedWindowBounds(window);
35 else 35 else
36 return GetDisplayParentBounds(window); 36 return GetDisplayBoundsInParent(window);
37 } 37 }
38 38
39 // static 39 // static
40 gfx::Rect ScreenAsh::GetUnmaximizedWorkAreaParentBounds(aura::Window* window) { 40 gfx::Rect ScreenAsh::GetUnmaximizedWorkAreaBoundsInParent(
41 aura::Window* window) {
41 if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) 42 if (window->GetRootWindow() == Shell::GetPrimaryRootWindow())
42 return Shell::GetInstance()->shelf()->GetUnmaximizedWorkAreaBounds(window); 43 return Shell::GetInstance()->shelf()->GetUnmaximizedWorkAreaBounds(window);
43 else 44 else
44 return GetDisplayWorkAreaParentBounds(window); 45 return GetDisplayWorkAreaBoundsInParent(window);
45 } 46 }
46 47
47 // static 48 // static
48 gfx::Rect ScreenAsh::GetDisplayParentBounds(aura::Window* window) { 49 gfx::Rect ScreenAsh::GetDisplayBoundsInParent(aura::Window* window) {
49 return ConvertRectFromScreen( 50 return ConvertRectFromScreen(
50 window->parent(), 51 window->parent(),
51 gfx::Screen::GetDisplayNearestWindow(window).bounds()); 52 gfx::Screen::GetDisplayNearestWindow(window).bounds());
52 } 53 }
53 54
54 // static 55 // static
55 gfx::Rect ScreenAsh::GetDisplayWorkAreaParentBounds(aura::Window* window) { 56 gfx::Rect ScreenAsh::GetDisplayWorkAreaBoundsInParent(aura::Window* window) {
56 return ConvertRectFromScreen( 57 return ConvertRectFromScreen(
57 window->parent(), 58 window->parent(),
58 gfx::Screen::GetDisplayNearestWindow(window).work_area()); 59 gfx::Screen::GetDisplayNearestWindow(window).work_area());
59 } 60 }
60 61
61 // static 62 // static
62 gfx::Rect ScreenAsh::ConvertRectToScreen(aura::Window* window, 63 gfx::Rect ScreenAsh::ConvertRectToScreen(aura::Window* window,
63 const gfx::Rect& rect) { 64 const gfx::Rect& rect) {
64 gfx::Point point = rect.origin(); 65 gfx::Point point = rect.origin();
65 aura::client::GetScreenPositionClient(window->GetRootWindow())-> 66 aura::client::GetScreenPositionClient(window->GetRootWindow())->
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 101
101 gfx::Display ScreenAsh::GetDisplayMatching(const gfx::Rect& match_rect) const { 102 gfx::Display ScreenAsh::GetDisplayMatching(const gfx::Rect& match_rect) const {
102 return GetDisplayManager()->GetDisplayMatching(match_rect); 103 return GetDisplayManager()->GetDisplayMatching(match_rect);
103 } 104 }
104 105
105 gfx::Display ScreenAsh::GetPrimaryDisplay() const { 106 gfx::Display ScreenAsh::GetPrimaryDisplay() const {
106 return *GetDisplayManager()->GetDisplayAt(0); 107 return *GetDisplayManager()->GetDisplayAt(0);
107 } 108 }
108 109
109 } // namespace ash 110 } // namespace ash
OLDNEW
« no previous file with comments | « ash/screen_ash.h ('k') | ash/screen_ash_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698