| 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/common/shelf/shelf_item_delegate.h" | 7 #include "ash/common/shelf/shelf_item_delegate.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "chrome/browser/extensions/context_menu_matcher.h" | 10 #include "chrome/browser/extensions/context_menu_matcher.h" |
| 11 #include "chrome/browser/extensions/extension_util.h" | 11 #include "chrome/browser/extensions/extension_util.h" |
| 12 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 12 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll
er.h" | 14 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll
er.h" |
| 15 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" | 15 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
| 16 #include "chrome/browser/ui/browser_commands.h" | 16 #include "chrome/browser/ui/browser_commands.h" |
| 17 #include "chrome/common/extensions/extension_constants.h" | 17 #include "chrome/common/extensions/extension_constants.h" |
| 18 #include "chrome/grit/generated_resources.h" | 18 #include "chrome/grit/generated_resources.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 IDS_APP_CONTEXT_MENU_OPEN_MAXIMIZED); | 75 IDS_APP_CONTEXT_MENU_OPEN_MAXIMIZED); |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 } else if (item().type == ash::TYPE_BROWSER_SHORTCUT) { | 78 } else if (item().type == ash::TYPE_BROWSER_SHORTCUT) { |
| 79 AddItemWithStringId(MENU_NEW_WINDOW, IDS_APP_LIST_NEW_WINDOW); | 79 AddItemWithStringId(MENU_NEW_WINDOW, IDS_APP_LIST_NEW_WINDOW); |
| 80 if (!controller()->GetProfile()->IsGuestSession()) { | 80 if (!controller()->GetProfile()->IsGuestSession()) { |
| 81 AddItemWithStringId(MENU_NEW_INCOGNITO_WINDOW, | 81 AddItemWithStringId(MENU_NEW_INCOGNITO_WINDOW, |
| 82 IDS_APP_LIST_NEW_INCOGNITO_WINDOW); | 82 IDS_APP_LIST_NEW_INCOGNITO_WINDOW); |
| 83 } | 83 } |
| 84 if (!BrowserShortcutLauncherItemController( | 84 if (!BrowserShortcutLauncherItemController( |
| 85 controller(), ash::Shell::GetInstance()->shelf_model()) | 85 controller(), ash::WmShell::Get()->shelf_model()) |
| 86 .IsListOfActiveBrowserEmpty()) { | 86 .IsListOfActiveBrowserEmpty()) { |
| 87 AddItem(MENU_CLOSE, | 87 AddItem(MENU_CLOSE, |
| 88 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); | 88 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); |
| 89 } | 89 } |
| 90 } else if (item().type == ash::TYPE_DIALOG) { | 90 } else if (item().type == ash::TYPE_DIALOG) { |
| 91 AddItemWithStringId(MENU_CLOSE, IDS_LAUNCHER_CONTEXT_MENU_CLOSE); | 91 AddItemWithStringId(MENU_CLOSE, IDS_LAUNCHER_CONTEXT_MENU_CLOSE); |
| 92 } else { | 92 } else { |
| 93 if (item().type == ash::TYPE_PLATFORM_APP) | 93 if (item().type == ash::TYPE_PLATFORM_APP) |
| 94 AddPinMenu(); | 94 AddPinMenu(); |
| 95 bool show_close_button = controller()->IsOpen(item().id); | 95 bool show_close_button = controller()->IsOpen(item().id); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 chrome::NewEmptyWindow( | 220 chrome::NewEmptyWindow( |
| 221 controller()->GetProfile()->GetOffTheRecordProfile()); | 221 controller()->GetProfile()->GetOffTheRecordProfile()); |
| 222 break; | 222 break; |
| 223 default: | 223 default: |
| 224 if (extension_items_) { | 224 if (extension_items_) { |
| 225 extension_items_->ExecuteCommand(command_id, nullptr, nullptr, | 225 extension_items_->ExecuteCommand(command_id, nullptr, nullptr, |
| 226 content::ContextMenuParams()); | 226 content::ContextMenuParams()); |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 } | 229 } |
| OLD | NEW |