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

Side by Side Diff: ash/wm/workspace/frame_maximize_button.cc

Issue 11017079: Remove Shell::shelf()|status_area_widget()|launcher() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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_animations.cc ('k') | ash/wm/workspace/workspace_layout_manager2_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/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/maximize_bubble_controller.h" 10 #include "ash/wm/maximize_bubble_controller.h"
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 case SNAP_LEFT: 470 case SNAP_LEFT:
471 case SNAP_RIGHT: 471 case SNAP_RIGHT:
472 return ScreenAsh::ConvertRectToScreen( 472 return ScreenAsh::ConvertRectToScreen(
473 frame_->GetWidget()->GetNativeView()->parent(), 473 frame_->GetWidget()->GetNativeView()->parent(),
474 snap_sizer.target_bounds()); 474 snap_sizer.target_bounds());
475 case SNAP_MAXIMIZE: 475 case SNAP_MAXIMIZE:
476 return ScreenAsh::ConvertRectToScreen( 476 return ScreenAsh::ConvertRectToScreen(
477 window->parent(), 477 window->parent(),
478 ScreenAsh::GetMaximizedWindowBoundsInParent(window)); 478 ScreenAsh::GetMaximizedWindowBoundsInParent(window));
479 case SNAP_MINIMIZE: { 479 case SNAP_MINIMIZE: {
480 Launcher* launcher = Shell::GetInstance()->launcher(); 480 Launcher* launcher = Launcher::ForWindow(window);
481 // Launcher is created lazily and can be NULL.
482 if (!launcher)
483 return gfx::Rect();
481 gfx::Rect item_rect(launcher->GetScreenBoundsOfItemIconForWindow( 484 gfx::Rect item_rect(launcher->GetScreenBoundsOfItemIconForWindow(
482 window)); 485 window));
483 if (!item_rect.IsEmpty()) { 486 if (!item_rect.IsEmpty()) {
484 // PhantomWindowController insets slightly, outset it so the phantom 487 // PhantomWindowController insets slightly, outset it so the phantom
485 // doesn't appear inset. 488 // doesn't appear inset.
486 item_rect.Inset(-8, -8); 489 item_rect.Inset(-8, -8);
487 return item_rect; 490 return item_rect;
488 } 491 }
489 return launcher->widget()->GetWindowBoundsInScreen(); 492 return launcher->widget()->GetWindowBoundsInScreen();
490 } 493 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 return FRAME_STATE_SNAP_LEFT; 577 return FRAME_STATE_SNAP_LEFT;
575 if (bounds.right() == screen.right()) 578 if (bounds.right() == screen.right())
576 return FRAME_STATE_SNAP_RIGHT; 579 return FRAME_STATE_SNAP_RIGHT;
577 // If we come here, it is likely caused by the fact that the 580 // If we come here, it is likely caused by the fact that the
578 // "VerticalResizeDoubleClick" stored a restore rectangle. In that case 581 // "VerticalResizeDoubleClick" stored a restore rectangle. In that case
579 // we allow all maximize operations (and keep the restore rectangle). 582 // we allow all maximize operations (and keep the restore rectangle).
580 return FRAME_STATE_NONE; 583 return FRAME_STATE_NONE;
581 } 584 }
582 585
583 } // namespace ash 586 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_animations.cc ('k') | ash/wm/workspace/workspace_layout_manager2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698