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/shelf/shelf_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <cstring> | 9 #include <cstring> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "ash/ash_switches.h" | 13 #include "ash/ash_switches.h" |
14 #include "ash/launcher/launcher_types.h" | |
15 #include "ash/root_window_controller.h" | 14 #include "ash/root_window_controller.h" |
16 #include "ash/screen_ash.h" | 15 #include "ash/screen_ash.h" |
17 #include "ash/session_state_delegate.h" | 16 #include "ash/session_state_delegate.h" |
18 #include "ash/shelf/shelf.h" | 17 #include "ash/shelf/shelf.h" |
19 #include "ash/shelf/shelf_bezel_event_filter.h" | 18 #include "ash/shelf/shelf_bezel_event_filter.h" |
| 19 #include "ash/shelf/shelf_constants.h" |
20 #include "ash/shelf/shelf_layout_manager_observer.h" | 20 #include "ash/shelf/shelf_layout_manager_observer.h" |
21 #include "ash/shelf/shelf_widget.h" | 21 #include "ash/shelf/shelf_widget.h" |
22 #include "ash/shell.h" | 22 #include "ash/shell.h" |
23 #include "ash/shell_window_ids.h" | 23 #include "ash/shell_window_ids.h" |
24 #include "ash/system/status_area_widget.h" | 24 #include "ash/system/status_area_widget.h" |
25 #include "ash/wm/gestures/shelf_gesture_handler.h" | 25 #include "ash/wm/gestures/shelf_gesture_handler.h" |
26 #include "ash/wm/lock_state_controller.h" | 26 #include "ash/wm/lock_state_controller.h" |
27 #include "ash/wm/mru_window_tracker.h" | 27 #include "ash/wm/mru_window_tracker.h" |
28 #include "ash/wm/window_animations.h" | 28 #include "ash/wm/window_animations.h" |
29 #include "ash/wm/window_state.h" | 29 #include "ash/wm/window_state.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 const int ShelfLayoutManager::kAutoHideSize = 3; | 95 const int ShelfLayoutManager::kAutoHideSize = 3; |
96 | 96 |
97 // static | 97 // static |
98 const int ShelfLayoutManager::kShelfSize = 47; | 98 const int ShelfLayoutManager::kShelfSize = 47; |
99 | 99 |
100 // static | 100 // static |
101 const int ShelfLayoutManager::kShelfItemInset = 3; | 101 const int ShelfLayoutManager::kShelfItemInset = 3; |
102 | 102 |
103 int ShelfLayoutManager::GetPreferredShelfSize() { | 103 int ShelfLayoutManager::GetPreferredShelfSize() { |
104 return ash::switches::UseAlternateShelfLayout() ? | 104 return ash::switches::UseAlternateShelfLayout() ? |
105 ShelfLayoutManager::kShelfSize : kLauncherPreferredSize; | 105 ShelfLayoutManager::kShelfSize : kShelfPreferredSize; |
106 } | 106 } |
107 | 107 |
108 // ShelfLayoutManager::AutoHideEventFilter ------------------------------------- | 108 // ShelfLayoutManager::AutoHideEventFilter ------------------------------------- |
109 | 109 |
110 // Notifies ShelfLayoutManager any time the mouse moves. | 110 // Notifies ShelfLayoutManager any time the mouse moves. |
111 class ShelfLayoutManager::AutoHideEventFilter : public ui::EventHandler { | 111 class ShelfLayoutManager::AutoHideEventFilter : public ui::EventHandler { |
112 public: | 112 public: |
113 explicit AutoHideEventFilter(ShelfLayoutManager* shelf); | 113 explicit AutoHideEventFilter(ShelfLayoutManager* shelf); |
114 virtual ~AutoHideEventFilter(); | 114 virtual ~AutoHideEventFilter(); |
115 | 115 |
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 return gfx::Insets(0, distance, 0, 0); | 1157 return gfx::Insets(0, distance, 0, 0); |
1158 case SHELF_ALIGNMENT_TOP: | 1158 case SHELF_ALIGNMENT_TOP: |
1159 return gfx::Insets(0, 0, distance, 0); | 1159 return gfx::Insets(0, 0, distance, 0); |
1160 } | 1160 } |
1161 NOTREACHED(); | 1161 NOTREACHED(); |
1162 return gfx::Insets(); | 1162 return gfx::Insets(); |
1163 } | 1163 } |
1164 | 1164 |
1165 } // namespace internal | 1165 } // namespace internal |
1166 } // namespace ash | 1166 } // namespace ash |
OLD | NEW |