Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: ash/launcher/launcher.cc

Issue 23606016: Refactor LauncherItemController and LauncherItemDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for LauncherTest and observing LauncherModel in DelegateManager Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698