OLD | NEW |
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/shelf/shelf_widget.h" |
9 #include "ash/shell.h" | 10 #include "ash/shell.h" |
10 #include "ash/shell_delegate.h" | 11 #include "ash/shell_delegate.h" |
11 #include "ash/wm/maximize_bubble_controller.h" | 12 #include "ash/wm/maximize_bubble_controller.h" |
12 #include "ash/wm/property_util.h" | 13 #include "ash/wm/property_util.h" |
13 #include "ash/wm/workspace/phantom_window_controller.h" | 14 #include "ash/wm/workspace/phantom_window_controller.h" |
14 #include "ash/wm/workspace/snap_sizer.h" | 15 #include "ash/wm/workspace/snap_sizer.h" |
15 #include "grit/ash_strings.h" | 16 #include "grit/ash_strings.h" |
16 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
17 #include "ui/base/events/event.h" | 18 #include "ui/base/events/event.h" |
18 #include "ui/base/events/event_handler.h" | 19 #include "ui/base/events/event_handler.h" |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 if (!launcher) | 465 if (!launcher) |
465 return gfx::Rect(); | 466 return gfx::Rect(); |
466 gfx::Rect item_rect(launcher->GetScreenBoundsOfItemIconForWindow( | 467 gfx::Rect item_rect(launcher->GetScreenBoundsOfItemIconForWindow( |
467 window)); | 468 window)); |
468 if (!item_rect.IsEmpty()) { | 469 if (!item_rect.IsEmpty()) { |
469 // PhantomWindowController insets slightly, outset it so the phantom | 470 // PhantomWindowController insets slightly, outset it so the phantom |
470 // doesn't appear inset. | 471 // doesn't appear inset. |
471 item_rect.Inset(-8, -8); | 472 item_rect.Inset(-8, -8); |
472 return item_rect; | 473 return item_rect; |
473 } | 474 } |
474 return launcher->widget()->GetWindowBoundsInScreen(); | 475 return launcher->shelf_widget()->GetWindowBoundsInScreen(); |
475 } | 476 } |
476 case SNAP_RESTORE: { | 477 case SNAP_RESTORE: { |
477 const gfx::Rect* restore = GetRestoreBoundsInScreen(window); | 478 const gfx::Rect* restore = GetRestoreBoundsInScreen(window); |
478 return restore ? | 479 return restore ? |
479 *restore : frame_->GetWidget()->GetWindowBoundsInScreen(); | 480 *restore : frame_->GetWidget()->GetWindowBoundsInScreen(); |
480 } | 481 } |
481 case SNAP_NONE: | 482 case SNAP_NONE: |
482 NOTREACHED(); | 483 NOTREACHED(); |
483 } | 484 } |
484 return gfx::Rect(); | 485 return gfx::Rect(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 return FRAME_STATE_SNAP_LEFT; | 570 return FRAME_STATE_SNAP_LEFT; |
570 if (bounds.right() == screen.right()) | 571 if (bounds.right() == screen.right()) |
571 return FRAME_STATE_SNAP_RIGHT; | 572 return FRAME_STATE_SNAP_RIGHT; |
572 // If we come here, it is likely caused by the fact that the | 573 // If we come here, it is likely caused by the fact that the |
573 // "VerticalResizeDoubleClick" stored a restore rectangle. In that case | 574 // "VerticalResizeDoubleClick" stored a restore rectangle. In that case |
574 // we allow all maximize operations (and keep the restore rectangle). | 575 // we allow all maximize operations (and keep the restore rectangle). |
575 return FRAME_STATE_NONE; | 576 return FRAME_STATE_NONE; |
576 } | 577 } |
577 | 578 |
578 } // namespace ash | 579 } // namespace ash |
OLD | NEW |