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/launcher/launcher.h" | 5 #include "ash/launcher/launcher.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "ash/focus_cycler.h" | 10 #include "ash/focus_cycler.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 void Launcher::ActivateLauncherItem(int index) { | 103 void Launcher::ActivateLauncherItem(int index) { |
104 // We pass in a keyboard event which will then trigger a switch to the | 104 // We pass in a keyboard event which will then trigger a switch to the |
105 // next item if the current one is already active. | 105 // next item if the current one is already active. |
106 ui::KeyEvent event(ui::ET_KEY_RELEASED, | 106 ui::KeyEvent event(ui::ET_KEY_RELEASED, |
107 ui::VKEY_UNKNOWN, // The actual key gets ignored. | 107 ui::VKEY_UNKNOWN, // The actual key gets ignored. |
108 ui::EF_NONE, | 108 ui::EF_NONE, |
109 false); | 109 false); |
110 | 110 |
111 const ash::LauncherItem& item = launcher_view_->model()->items()[index]; | 111 const ash::LauncherItem& item = launcher_view_->model()->items()[index]; |
112 Shell::GetInstance()->launcher_item_delegate_manager()-> | 112 Shell::GetInstance()->launcher_item_delegate_manager()-> |
113 GetLauncherItemDelegate(item.type)->ItemSelected(item, event); | 113 GetLauncherItemDelegate(item.id)->ItemSelected(event); |
114 } | 114 } |
115 | 115 |
116 void Launcher::CycleWindowLinear(CycleDirection direction) { | 116 void Launcher::CycleWindowLinear(CycleDirection direction) { |
117 int item_index = GetNextActivatedItemIndex( | 117 int item_index = GetNextActivatedItemIndex( |
118 *(launcher_view_->model()), direction); | 118 *(launcher_view_->model()), direction); |
119 if (item_index >= 0) | 119 if (item_index >= 0) |
120 ActivateLauncherItem(item_index); | 120 ActivateLauncherItem(item_index); |
121 } | 121 } |
122 | 122 |
123 void Launcher::AddIconObserver(LauncherIconObserver* observer) { | 123 void Launcher::AddIconObserver(LauncherIconObserver* observer) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 gfx::Rect Launcher::GetLauncherViewBounds() const { | 188 gfx::Rect Launcher::GetLauncherViewBounds() const { |
189 return launcher_view_->bounds(); | 189 return launcher_view_->bounds(); |
190 } | 190 } |
191 | 191 |
192 app_list::ApplicationDragAndDropHost* Launcher::GetDragAndDropHostForAppList() { | 192 app_list::ApplicationDragAndDropHost* Launcher::GetDragAndDropHostForAppList() { |
193 return launcher_view_; | 193 return launcher_view_; |
194 } | 194 } |
195 | 195 |
196 } // namespace ash | 196 } // namespace ash |
OLD | NEW |