| 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/common/shelf/shelf_delegate.h" | 9 #include "ash/common/shelf/shelf_delegate.h" |
| 10 #include "ash/common/shelf/shelf_model.h" | 10 #include "ash/common/shelf/shelf_model.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 215 |
| 216 ash::ShelfItemDelegate::PerformedAction | 216 ash::ShelfItemDelegate::PerformedAction |
| 217 BrowserShortcutLauncherItemController::ItemSelected(const ui::Event& event) { | 217 BrowserShortcutLauncherItemController::ItemSelected(const ui::Event& event) { |
| 218 if (event.flags() & ui::EF_CONTROL_DOWN) { | 218 if (event.flags() & ui::EF_CONTROL_DOWN) { |
| 219 chrome::NewEmptyWindow(launcher_controller()->GetProfile()); | 219 chrome::NewEmptyWindow(launcher_controller()->GetProfile()); |
| 220 return kNewWindowCreated; | 220 return kNewWindowCreated; |
| 221 } | 221 } |
| 222 | 222 |
| 223 // In case of a keyboard event, we were called by a hotkey. In that case we | 223 // In case of a keyboard event, we were called by a hotkey. In that case we |
| 224 // activate the next item in line if an item of our list is already active. | 224 // activate the next item in line if an item of our list is already active. |
| 225 if (event.type() & ui::ET_KEY_RELEASED) { | 225 if (event.type() == ui::ET_KEY_RELEASED) { |
| 226 return ActivateOrAdvanceToNextBrowser(); | 226 return ActivateOrAdvanceToNextBrowser(); |
| 227 } | 227 } |
| 228 | 228 |
| 229 return Activate(ash::LAUNCH_FROM_UNKNOWN); | 229 return Activate(ash::LAUNCH_FROM_UNKNOWN); |
| 230 } | 230 } |
| 231 | 231 |
| 232 base::string16 BrowserShortcutLauncherItemController::GetTitle() { | 232 base::string16 BrowserShortcutLauncherItemController::GetTitle() { |
| 233 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); | 233 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
| 234 } | 234 } |
| 235 | 235 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 !browser->window()->IsMinimized()) { | 358 !browser->window()->IsMinimized()) { |
| 359 continue; | 359 continue; |
| 360 } | 360 } |
| 361 if (!IsBrowserRepresentedInBrowserList(browser) && | 361 if (!IsBrowserRepresentedInBrowserList(browser) && |
| 362 !browser->is_type_tabbed()) | 362 !browser->is_type_tabbed()) |
| 363 continue; | 363 continue; |
| 364 active_browsers.push_back(browser); | 364 active_browsers.push_back(browser); |
| 365 } | 365 } |
| 366 return active_browsers; | 366 return active_browsers; |
| 367 } | 367 } |
| OLD | NEW |