OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h" |
6 | 6 |
7 #include "ash/shelf/shelf_model.h" | 7 #include "ash/shelf/shelf_model.h" |
8 #include "ash/wm/window_state.h" | 8 #include "ash/wm/window_state.h" |
9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" | 10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 items.push_back(new ChromeLauncherAppMenuItemV2App( | 174 items.push_back(new ChromeLauncherAppMenuItemV2App( |
175 app_window->GetTitle(), | 175 app_window->GetTitle(), |
176 &result, // Will be copied | 176 &result, // Will be copied |
177 app_id(), | 177 app_id(), |
178 launcher_controller(), | 178 launcher_controller(), |
179 index, | 179 index, |
180 index == 0 /* has_leading_separator */)); | 180 index == 0 /* has_leading_separator */)); |
181 ++index; | 181 ++index; |
182 } | 182 } |
183 return items.Pass(); | 183 return items; |
184 } | 184 } |
185 | 185 |
186 ash::ShelfItemDelegate::PerformedAction | 186 ash::ShelfItemDelegate::PerformedAction |
187 AppWindowLauncherItemController::ItemSelected(const ui::Event& event) { | 187 AppWindowLauncherItemController::ItemSelected(const ui::Event& event) { |
188 if (app_windows_.empty()) | 188 if (app_windows_.empty()) |
189 return kNoAction; | 189 return kNoAction; |
190 if (type() == TYPE_APP_PANEL) { | 190 if (type() == TYPE_APP_PANEL) { |
191 DCHECK_EQ(app_windows_.size(), 1u); | 191 DCHECK_EQ(app_windows_.size(), 1u); |
192 AppWindow* panel = app_windows_.front(); | 192 AppWindow* panel = app_windows_.front(); |
193 aura::Window* panel_window = panel->GetNativeWindow(); | 193 aura::Window* panel_window = panel->GetNativeWindow(); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 if (window_to_show->GetBaseWindow()->IsActive()) { | 297 if (window_to_show->GetBaseWindow()->IsActive()) { |
298 // Coming here, only a single window is active. For keyboard activations | 298 // Coming here, only a single window is active. For keyboard activations |
299 // the window gets animated. | 299 // the window gets animated. |
300 AnimateWindow(window_to_show->GetNativeWindow(), | 300 AnimateWindow(window_to_show->GetNativeWindow(), |
301 wm::WINDOW_ANIMATION_TYPE_BOUNCE); | 301 wm::WINDOW_ANIMATION_TYPE_BOUNCE); |
302 } else { | 302 } else { |
303 return ShowAndActivateOrMinimize(window_to_show); | 303 return ShowAndActivateOrMinimize(window_to_show); |
304 } | 304 } |
305 return kNoAction; | 305 return kNoAction; |
306 } | 306 } |
OLD | NEW |