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

Side by Side Diff: chrome/browser/ui/window_sizer_ash.cc

Issue 10210005: Ash/aura split: NativeWidgetAura::GetWindowScreenBounds() should return screen bounds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sky+oshima stuff Created 8 years, 8 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
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 "chrome/browser/ui/window_sizer.h" 5 #include "chrome/browser/ui/window_sizer.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm/window_cycle_controller.h" 8 #include "ash/wm/window_cycle_controller.h"
9 #include "ash/wm/window_util.h" 9 #include "ash/wm/window_util.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 *bounds = specified_bounds; 77 *bounds = specified_bounds;
78 DCHECK(bounds->IsEmpty()); 78 DCHECK(bounds->IsEmpty());
79 if (browser_ != NULL && browser_->type() == Browser::TYPE_TABBED) { 79 if (browser_ != NULL && browser_->type() == Browser::TYPE_TABBED) {
80 // This is a window / app. See if there is no window and try to place it. 80 // This is a window / app. See if there is no window and try to place it.
81 aura::Window* top_window = GetTopWindow(); 81 aura::Window* top_window = GetTopWindow();
82 // If there are no windows we have a special case and try to 82 // If there are no windows we have a special case and try to
83 // maximize which leaves a 'border' which shows the desktop. 83 // maximize which leaves a 'border' which shows the desktop.
84 if (top_window == NULL) { 84 if (top_window == NULL) {
85 GetDefaultWindowBounds(bounds); 85 GetDefaultWindowBounds(bounds);
86 } else { 86 } else {
87 *bounds = top_window->GetScreenBounds(); 87 *bounds = top_window->GetBoundsInRootWindow();
88 } 88 }
89 return true; 89 return true;
90 // If both fail we will continue the default path. 90 // If both fail we will continue the default path.
91 } 91 }
92 92
93 return false; 93 return false;
94 } 94 }
95 95
96 void WindowSizer::GetDefaultWindowBounds(gfx::Rect* default_bounds) const { 96 void WindowSizer::GetDefaultWindowBounds(gfx::Rect* default_bounds) const {
97 DCHECK(default_bounds); 97 DCHECK(default_bounds);
(...skipping 19 matching lines...) Expand all
117 // The window should get centered on the screen and not follow the grid. 117 // The window should get centered on the screen and not follow the grid.
118 offset_x = (work_area.width() - maximum_window_width) / 2; 118 offset_x = (work_area.width() - maximum_window_width) / 2;
119 // Never make a window wider then 1280. 119 // Never make a window wider then 1280.
120 default_width = maximum_window_width; 120 default_width = maximum_window_width;
121 } 121 }
122 default_bounds->SetRect(work_area.x() + offset_x, 122 default_bounds->SetRect(work_area.x() + offset_x,
123 work_area.y() + kDesktopBorderSize, 123 work_area.y() + kDesktopBorderSize,
124 default_width, 124 default_width,
125 default_height); 125 default_height);
126 } 126 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/hung_renderer_view.cc ('k') | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698