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