OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/aura_shell/app_list.h" | 5 #include "ui/aura_shell/app_list/app_list.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "ui/aura/event.h" | 8 #include "ui/aura/event.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/aura_shell/shell.h" | 10 #include "ui/aura_shell/shell.h" |
11 #include "ui/aura_shell/shell_delegate.h" | 11 #include "ui/aura_shell/shell_delegate.h" |
12 #include "ui/aura_shell/shell_window_ids.h" | 12 #include "ui/aura_shell/shell_window_ids.h" |
13 #include "ui/gfx/screen.h" | 13 #include "ui/gfx/screen.h" |
14 | 14 |
15 namespace aura_shell { | 15 namespace aura_shell { |
16 namespace internal { | 16 namespace internal { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // Gets preferred bounds of app list window in show/hide state. | 20 // Gets preferred bounds of app list window in show/hide state. |
21 gfx::Rect GetPreferredBounds(bool show) { | 21 gfx::Rect GetPreferredBounds(bool show) { |
22 // The y-axis offset used at the beginning of showing animation. | 22 // The y-axis offset used at the beginning of showing animation. |
23 static const int kMoveUpAnimationOffset = 50; | 23 static const int kMoveUpAnimationOffset = 50; |
24 | 24 |
25 gfx::Point cursor = gfx::Screen::GetCursorScreenPoint(); | 25 gfx::Point cursor = gfx::Screen::GetCursorScreenPoint(); |
26 gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestPoint(cursor); | 26 gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestPoint(cursor); |
27 gfx::Rect widget_bounds(work_area); | 27 gfx::Rect widget_bounds(work_area); |
28 widget_bounds.Inset(150, 100); | 28 widget_bounds.Inset(100, 100); |
29 if (!show) | 29 if (!show) |
30 widget_bounds.Offset(0, kMoveUpAnimationOffset); | 30 widget_bounds.Offset(0, kMoveUpAnimationOffset); |
31 | 31 |
32 return widget_bounds; | 32 return widget_bounds; |
33 } | 33 } |
34 | 34 |
35 ui::Layer* GetLayer(views::Widget* widget) { | 35 ui::Layer* GetLayer(views::Widget* widget) { |
36 return widget->GetNativeView()->layer(); | 36 return widget->GetNativeView()->layer(); |
37 } | 37 } |
38 | 38 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 } | 168 } |
169 | 169 |
170 void AppList::OnWidgetActivationChanged(views::Widget* widget, bool active) { | 170 void AppList::OnWidgetActivationChanged(views::Widget* widget, bool active) { |
171 DCHECK(widget_ == widget); | 171 DCHECK(widget_ == widget); |
172 if (widget_ && is_visible_ && !active) | 172 if (widget_ && is_visible_ && !active) |
173 SetVisible(false); | 173 SetVisible(false); |
174 } | 174 } |
175 | 175 |
176 } // namespace internal | 176 } // namespace internal |
177 } // namespace aura_shell | 177 } // namespace aura_shell |
OLD | NEW |