| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/extension_launcher_context_menu.h" | 5 #include "chrome/browser/ui/ash/launcher/extension_launcher_context_menu.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "chrome/browser/extensions/context_menu_matcher.h" | 9 #include "chrome/browser/extensions/context_menu_matcher.h" |
| 10 #include "chrome/browser/extensions/extension_util.h" | 10 #include "chrome/browser/extensions/extension_util.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 AddCheckItemWithStringId(LAUNCH_TYPE_FULLSCREEN, | 76 AddCheckItemWithStringId(LAUNCH_TYPE_FULLSCREEN, |
| 77 IDS_APP_CONTEXT_MENU_OPEN_MAXIMIZED); | 77 IDS_APP_CONTEXT_MENU_OPEN_MAXIMIZED); |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 } else if (item().type == ash::TYPE_BROWSER_SHORTCUT) { | 80 } else if (item().type == ash::TYPE_BROWSER_SHORTCUT) { |
| 81 AddItemWithStringId(MENU_NEW_WINDOW, IDS_APP_LIST_NEW_WINDOW); | 81 AddItemWithStringId(MENU_NEW_WINDOW, IDS_APP_LIST_NEW_WINDOW); |
| 82 if (!controller()->profile()->IsGuestSession()) { | 82 if (!controller()->profile()->IsGuestSession()) { |
| 83 AddItemWithStringId(MENU_NEW_INCOGNITO_WINDOW, | 83 AddItemWithStringId(MENU_NEW_INCOGNITO_WINDOW, |
| 84 IDS_APP_LIST_NEW_INCOGNITO_WINDOW); | 84 IDS_APP_LIST_NEW_INCOGNITO_WINDOW); |
| 85 } | 85 } |
| 86 if (!BrowserShortcutLauncherItemController(controller(), | 86 if (!BrowserShortcutLauncherItemController(ash::Shell::Get()->shelf_model()) |
| 87 ash::Shell::Get()->shelf_model()) | |
| 88 .IsListOfActiveBrowserEmpty()) { | 87 .IsListOfActiveBrowserEmpty()) { |
| 89 AddItem(MENU_CLOSE, | 88 AddItem(MENU_CLOSE, |
| 90 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); | 89 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); |
| 91 } | 90 } |
| 92 } else if (item().type == ash::TYPE_DIALOG) { | 91 } else if (item().type == ash::TYPE_DIALOG) { |
| 93 AddItemWithStringId(MENU_CLOSE, IDS_LAUNCHER_CONTEXT_MENU_CLOSE); | 92 AddItemWithStringId(MENU_CLOSE, IDS_LAUNCHER_CONTEXT_MENU_CLOSE); |
| 94 } else if (controller()->IsOpen(item().id)) { | 93 } else if (controller()->IsOpen(item().id)) { |
| 95 AddItemWithStringId(MENU_CLOSE, IDS_LAUNCHER_CONTEXT_MENU_CLOSE); | 94 AddItemWithStringId(MENU_CLOSE, IDS_LAUNCHER_CONTEXT_MENU_CLOSE); |
| 96 } | 95 } |
| 97 AddSeparator(ui::NORMAL_SEPARATOR); | 96 AddSeparator(ui::NORMAL_SEPARATOR); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 return extensions::LAUNCH_TYPE_DEFAULT; | 220 return extensions::LAUNCH_TYPE_DEFAULT; |
| 222 | 221 |
| 223 return extensions::GetLaunchType( | 222 return extensions::GetLaunchType( |
| 224 extensions::ExtensionPrefs::Get(controller()->profile()), extension); | 223 extensions::ExtensionPrefs::Get(controller()->profile()), extension); |
| 225 } | 224 } |
| 226 | 225 |
| 227 void ExtensionLauncherContextMenu::SetLaunchType(extensions::LaunchType type) { | 226 void ExtensionLauncherContextMenu::SetLaunchType(extensions::LaunchType type) { |
| 228 extensions::SetLaunchType(controller()->profile(), | 227 extensions::SetLaunchType(controller()->profile(), |
| 229 item().app_launch_id.app_id(), type); | 228 item().app_launch_id.app_id(), type); |
| 230 } | 229 } |
| OLD | NEW |