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 ash::LauncherItemDelegate* item_delegate = | 111 Shell::GetInstance()->launcher_item_delegate_manager()-> |
112 Shell::GetInstance()->launcher_item_delegate_manager()-> | 112 GetLauncherItemDelegate(item.type)->ItemSelected(item, event); |
113 GetLauncherItemDelegate(item.id); | |
114 if (item_delegate) | |
115 item_delegate->ItemSelected(event); | |
116 } | 113 } |
117 | 114 |
118 void Launcher::CycleWindowLinear(CycleDirection direction) { | 115 void Launcher::CycleWindowLinear(CycleDirection direction) { |
119 int item_index = GetNextActivatedItemIndex( | 116 int item_index = GetNextActivatedItemIndex( |
120 *(launcher_view_->model()), direction); | 117 *(launcher_view_->model()), direction); |
121 if (item_index >= 0) | 118 if (item_index >= 0) |
122 ActivateLauncherItem(item_index); | 119 ActivateLauncherItem(item_index); |
123 } | 120 } |
124 | 121 |
125 void Launcher::AddIconObserver(LauncherIconObserver* observer) { | 122 void Launcher::AddIconObserver(LauncherIconObserver* observer) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 182 |
186 gfx::Rect Launcher::GetLauncherViewBounds() const { | 183 gfx::Rect Launcher::GetLauncherViewBounds() const { |
187 return launcher_view_->bounds(); | 184 return launcher_view_->bounds(); |
188 } | 185 } |
189 | 186 |
190 app_list::ApplicationDragAndDropHost* Launcher::GetDragAndDropHostForAppList() { | 187 app_list::ApplicationDragAndDropHost* Launcher::GetDragAndDropHostForAppList() { |
191 return launcher_view_; | 188 return launcher_view_; |
192 } | 189 } |
193 | 190 |
194 } // namespace ash | 191 } // namespace ash |
OLD | NEW |