| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 AddPinMenu(); | 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) | |
| 89 if (extension_misc::IsImeMenuExtensionId( | 88 if (extension_misc::IsImeMenuExtensionId( |
| 90 controller()->GetAppIDForShelfID(item().id))) | 89 controller()->GetAppIDForShelfID(item().id))) { |
| 91 show_close_button = false; | 90 show_close_button = false; |
| 92 #endif | 91 } |
| 92 |
| 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); |
| 97 if (item().type == ash::TYPE_APP_SHORTCUT || | 97 if (item().type == ash::TYPE_APP_SHORTCUT || |
| 98 item().type == ash::TYPE_WINDOWED_APP || | 98 item().type == ash::TYPE_WINDOWED_APP || |
| 99 item().type == ash::TYPE_PLATFORM_APP) { | 99 item().type == ash::TYPE_PLATFORM_APP) { |
| 100 const extensions::MenuItem::ExtensionKey app_key( | 100 const extensions::MenuItem::ExtensionKey app_key( |
| 101 controller()->GetAppIDForShelfID(item().id)); | 101 controller()->GetAppIDForShelfID(item().id)); |
| 102 if (!app_key.empty()) { | 102 if (!app_key.empty()) { |
| (...skipping 108 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 |