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

Side by Side Diff: ash/wm/workspace/frame_maximize_button.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/wm/window_resizer.cc ('k') | ash/wm/workspace/maximized_workspace.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/wm/workspace/frame_maximize_button.h" 5 #include "ash/wm/workspace/frame_maximize_button.h"
6 6
7 #include "ash/launcher/launcher.h" 7 #include "ash/launcher/launcher.h"
8 #include "ash/screen_ash.h" 8 #include "ash/screen_ash.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/property_util.h" 10 #include "ash/wm/property_util.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 aura::Window* window = frame_->GetWidget()->GetNativeWindow(); 355 aura::Window* window = frame_->GetWidget()->GetNativeWindow();
356 switch (type) { 356 switch (type) {
357 case SNAP_LEFT: 357 case SNAP_LEFT:
358 case SNAP_RIGHT: 358 case SNAP_RIGHT:
359 return ScreenAsh::ConvertRectToScreen( 359 return ScreenAsh::ConvertRectToScreen(
360 frame_->GetWidget()->GetNativeView()->parent(), 360 frame_->GetWidget()->GetNativeView()->parent(),
361 snap_sizer_->target_bounds()); 361 snap_sizer_->target_bounds());
362 case SNAP_MAXIMIZE: 362 case SNAP_MAXIMIZE:
363 return ScreenAsh::ConvertRectToScreen( 363 return ScreenAsh::ConvertRectToScreen(
364 window->parent(), 364 window->parent(),
365 ScreenAsh::GetMaximizedWindowParentBounds(window)); 365 ScreenAsh::GetMaximizedWindowBoundsInParent(window));
366 case SNAP_MINIMIZE: { 366 case SNAP_MINIMIZE: {
367 Launcher* launcher = Shell::GetInstance()->launcher(); 367 Launcher* launcher = Shell::GetInstance()->launcher();
368 gfx::Rect item_rect(launcher->GetScreenBoundsOfItemIconForWindow(window)); 368 gfx::Rect item_rect(launcher->GetScreenBoundsOfItemIconForWindow(window));
369 if (!item_rect.IsEmpty()) { 369 if (!item_rect.IsEmpty()) {
370 // PhantomWindowController insets slightly, outset it so the phantom 370 // PhantomWindowController insets slightly, outset it so the phantom
371 // doesn't appear inset. 371 // doesn't appear inset.
372 item_rect.Inset(-8, -8); 372 item_rect.Inset(-8, -8);
373 return item_rect; 373 return item_rect;
374 } 374 }
375 return launcher->widget()->GetWindowScreenBounds(); 375 return launcher->widget()->GetWindowBoundsInScreen();
376 } 376 }
377 case SNAP_RESTORE: { 377 case SNAP_RESTORE: {
378 const gfx::Rect* restore = GetRestoreBoundsInScreen(window); 378 const gfx::Rect* restore = GetRestoreBoundsInScreen(window);
379 return restore ? *restore : frame_->GetWidget()->GetWindowScreenBounds(); 379 return restore ?
380 *restore : frame_->GetWidget()->GetWindowBoundsInScreen();
380 } 381 }
381 case SNAP_NONE: 382 case SNAP_NONE:
382 NOTREACHED(); 383 NOTREACHED();
383 } 384 }
384 return gfx::Rect(); 385 return gfx::Rect();
385 } 386 }
386 387
387 gfx::Point FrameMaximizeButton::LocationForSnapSizer( 388 gfx::Point FrameMaximizeButton::LocationForSnapSizer(
388 const gfx::Point& location) const { 389 const gfx::Point& location) const {
389 gfx::Point result(location); 390 gfx::Point result(location);
(...skipping 21 matching lines...) Expand all
411 break; 412 break;
412 case SNAP_RESTORE: 413 case SNAP_RESTORE:
413 frame_->GetWidget()->Restore(); 414 frame_->GetWidget()->Restore();
414 break; 415 break;
415 case SNAP_NONE: 416 case SNAP_NONE:
416 NOTREACHED(); 417 NOTREACHED();
417 } 418 }
418 } 419 }
419 420
420 } // namespace ash 421 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_resizer.cc ('k') | ash/wm/workspace/maximized_workspace.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698