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

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

Issue 97173003: ash: Rename more Launcher classes to Shelf*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: link chrome Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « ash/ash.gyp ('k') | ash/launcher/launcher_item_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "ash/launcher/launcher_delegate.h" 11 #include "ash/launcher/launcher_delegate.h"
12 #include "ash/launcher/launcher_item_delegate.h"
13 #include "ash/launcher/launcher_item_delegate_manager.h"
14 #include "ash/root_window_controller.h" 12 #include "ash/root_window_controller.h"
15 #include "ash/screen_ash.h" 13 #include "ash/screen_ash.h"
14 #include "ash/shelf/shelf_item_delegate.h"
15 #include "ash/shelf/shelf_item_delegate_manager.h"
16 #include "ash/shelf/shelf_layout_manager.h" 16 #include "ash/shelf/shelf_layout_manager.h"
17 #include "ash/shelf/shelf_model.h" 17 #include "ash/shelf/shelf_model.h"
18 #include "ash/shelf/shelf_navigator.h" 18 #include "ash/shelf/shelf_navigator.h"
19 #include "ash/shelf/shelf_util.h" 19 #include "ash/shelf/shelf_util.h"
20 #include "ash/shelf/shelf_view.h" 20 #include "ash/shelf/shelf_view.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_delegate.h" 23 #include "ash/shell_delegate.h"
24 #include "ash/shell_window_ids.h" 24 #include "ash/shell_window_ids.h"
25 #include "ash/wm/window_properties.h" 25 #include "ash/wm/window_properties.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 101 }
102 102
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 = shelf_view_->model()->items()[index]; 111 const LauncherItem& item = shelf_view_->model()->items()[index];
112 ash::LauncherItemDelegate* item_delegate = 112 ShelfItemDelegate* item_delegate =
113 Shell::GetInstance()->launcher_item_delegate_manager()-> 113 Shell::GetInstance()->shelf_item_delegate_manager()->GetShelfItemDelegate(
114 GetLauncherItemDelegate(item.id); 114 item.id);
115 item_delegate->ItemSelected(event); 115 item_delegate->ItemSelected(event);
116 } 116 }
117 117
118 void Launcher::CycleWindowLinear(CycleDirection direction) { 118 void Launcher::CycleWindowLinear(CycleDirection direction) {
119 int item_index = GetNextActivatedItemIndex( 119 int item_index = GetNextActivatedItemIndex(
120 *(shelf_view_->model()), direction); 120 *(shelf_view_->model()), direction);
121 if (item_index >= 0) 121 if (item_index >= 0)
122 ActivateLauncherItem(item_index); 122 ActivateLauncherItem(item_index);
123 } 123 }
124 124
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 gfx::Rect Launcher::GetVisibleItemsBoundsInScreen() const { 190 gfx::Rect Launcher::GetVisibleItemsBoundsInScreen() const {
191 return shelf_view_->GetVisibleItemsBoundsInScreen(); 191 return shelf_view_->GetVisibleItemsBoundsInScreen();
192 } 192 }
193 193
194 app_list::ApplicationDragAndDropHost* Launcher::GetDragAndDropHostForAppList() { 194 app_list::ApplicationDragAndDropHost* Launcher::GetDragAndDropHostForAppList() {
195 return shelf_view_; 195 return shelf_view_;
196 } 196 }
197 197
198 } // namespace ash 198 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash.gyp ('k') | ash/launcher/launcher_item_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698