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/shelf/shelf.h" | 7 #include "ash/shelf/shelf.h" |
8 #include "ash/shelf/shelf_item_delegate.h" | 8 #include "ash/shelf/shelf_item_delegate.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" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } else if (item().type == ash::TYPE_BROWSER_SHORTCUT) { | 76 } else if (item().type == ash::TYPE_BROWSER_SHORTCUT) { |
77 AddItemWithStringId(MENU_NEW_WINDOW, IDS_APP_LIST_NEW_WINDOW); | 77 AddItemWithStringId(MENU_NEW_WINDOW, IDS_APP_LIST_NEW_WINDOW); |
78 if (!controller()->IsLoggedInAsGuest()) { | 78 if (!controller()->IsLoggedInAsGuest()) { |
79 AddItemWithStringId(MENU_NEW_INCOGNITO_WINDOW, | 79 AddItemWithStringId(MENU_NEW_INCOGNITO_WINDOW, |
80 IDS_APP_LIST_NEW_INCOGNITO_WINDOW); | 80 IDS_APP_LIST_NEW_INCOGNITO_WINDOW); |
81 } | 81 } |
82 } else if (item().type == ash::TYPE_DIALOG) { | 82 } else if (item().type == ash::TYPE_DIALOG) { |
83 AddItemWithStringId(MENU_CLOSE, IDS_LAUNCHER_CONTEXT_MENU_CLOSE); | 83 AddItemWithStringId(MENU_CLOSE, IDS_LAUNCHER_CONTEXT_MENU_CLOSE); |
84 } else { | 84 } else { |
85 if (item().type == ash::TYPE_PLATFORM_APP) | 85 if (item().type == ash::TYPE_PLATFORM_APP) |
86 AddItemWithStringId(MENU_PIN, IDS_LAUNCHER_CONTEXT_MENU_PIN); | 86 AddPinMenu(); |
87 bool show_close_button = controller()->IsOpen(item().id); | 87 bool show_close_button = controller()->IsOpen(item().id); |
88 #if defined(OS_CHROMEOS) | 88 #if defined(OS_CHROMEOS) |
89 if (extension_misc::IsImeMenuExtensionId( | 89 if (extension_misc::IsImeMenuExtensionId( |
90 controller()->GetAppIDForShelfID(item().id))) | 90 controller()->GetAppIDForShelfID(item().id))) |
91 show_close_button = false; | 91 show_close_button = false; |
92 #endif | 92 #endif |
93 if (show_close_button) | 93 if (show_close_button) |
94 AddItemWithStringId(MENU_CLOSE, IDS_LAUNCHER_CONTEXT_MENU_CLOSE); | 94 AddItemWithStringId(MENU_CLOSE, IDS_LAUNCHER_CONTEXT_MENU_CLOSE); |
95 } | 95 } |
96 AddSeparator(ui::NORMAL_SEPARATOR); | 96 AddSeparator(ui::NORMAL_SEPARATOR); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 case MENU_NEW_INCOGNITO_WINDOW: | 211 case MENU_NEW_INCOGNITO_WINDOW: |
212 controller()->CreateNewIncognitoWindow(); | 212 controller()->CreateNewIncognitoWindow(); |
213 break; | 213 break; |
214 default: | 214 default: |
215 if (extension_items_) { | 215 if (extension_items_) { |
216 extension_items_->ExecuteCommand(command_id, nullptr, nullptr, | 216 extension_items_->ExecuteCommand(command_id, nullptr, nullptr, |
217 content::ContextMenuParams()); | 217 content::ContextMenuParams()); |
218 } | 218 } |
219 } | 219 } |
220 } | 220 } |
OLD | NEW |