OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser_shortcut_launcher_item_controll
er.h" | 5 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll
er.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
10 #include "ash/shelf/shelf_model.h" | 10 #include "ash/shelf/shelf_model.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 bool leading_separator = !index; | 230 bool leading_separator = !index; |
231 items.push_back(new ChromeLauncherAppMenuItemTab( | 231 items.push_back(new ChromeLauncherAppMenuItemTab( |
232 title, &app_icon, web_contents, leading_separator)); | 232 title, &app_icon, web_contents, leading_separator)); |
233 } | 233 } |
234 } | 234 } |
235 } | 235 } |
236 // If only windowed applications are open, we return an empty list to | 236 // If only windowed applications are open, we return an empty list to |
237 // enforce the creation of a new browser. | 237 // enforce the creation of a new browser. |
238 if (!found_tabbed_browser) | 238 if (!found_tabbed_browser) |
239 items.clear(); | 239 items.clear(); |
240 return items.Pass(); | 240 return items; |
241 } | 241 } |
242 | 242 |
243 ash::ShelfItemDelegate::PerformedAction | 243 ash::ShelfItemDelegate::PerformedAction |
244 BrowserShortcutLauncherItemController::ItemSelected(const ui::Event& event) { | 244 BrowserShortcutLauncherItemController::ItemSelected(const ui::Event& event) { |
245 if (event.flags() & ui::EF_CONTROL_DOWN) { | 245 if (event.flags() & ui::EF_CONTROL_DOWN) { |
246 launcher_controller()->CreateNewWindow(); | 246 launcher_controller()->CreateNewWindow(); |
247 return kNewWindowCreated; | 247 return kNewWindowCreated; |
248 } | 248 } |
249 | 249 |
250 // In case of a keyboard event, we were called by a hotkey. In that case we | 250 // In case of a keyboard event, we were called by a hotkey. In that case we |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 web_app::GetExtensionIdFromApplicationName(browser->app_name())) > 0) | 374 web_app::GetExtensionIdFromApplicationName(browser->app_name())) > 0) |
375 return false; | 375 return false; |
376 | 376 |
377 // Settings browsers have their own icon. | 377 // Settings browsers have their own icon. |
378 if (IsSettingsBrowser(browser)) | 378 if (IsSettingsBrowser(browser)) |
379 return false; | 379 return false; |
380 | 380 |
381 // Tabbed browser and other popup windows are all represented. | 381 // Tabbed browser and other popup windows are all represented. |
382 return true; | 382 return true; |
383 } | 383 } |
OLD | NEW |