| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/launcher_context_menu.h" | 5 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "ash/desktop_background/user_wallpaper_delegate.h" | 9 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| 10 #include "ash/metrics/user_metrics_recorder.h" | 10 #include "ash/metrics/user_metrics_recorder.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 143 } |
| 144 } else if (item_.type == ash::TYPE_DIALOG) { | 144 } else if (item_.type == ash::TYPE_DIALOG) { |
| 145 AddItem(MENU_CLOSE, | 145 AddItem(MENU_CLOSE, |
| 146 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); | 146 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); |
| 147 } else { | 147 } else { |
| 148 if (item_.type == ash::TYPE_PLATFORM_APP) { | 148 if (item_.type == ash::TYPE_PLATFORM_APP) { |
| 149 AddItem( | 149 AddItem( |
| 150 MENU_PIN, | 150 MENU_PIN, |
| 151 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_PIN)); | 151 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_PIN)); |
| 152 } | 152 } |
| 153 if (controller_->IsOpen(item_.id)) { | 153 bool show_close_button = controller_->IsOpen(item_.id); |
| 154 #if defined(OS_CHROMEOS) |
| 155 if (extension_misc::IsImeMenuExtensionId( |
| 156 controller_->GetAppIDForShelfID(item_.id))) { |
| 157 show_close_button = false; |
| 158 } |
| 159 #endif |
| 160 if (show_close_button) { |
| 154 AddItem(MENU_CLOSE, | 161 AddItem(MENU_CLOSE, |
| 155 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); | 162 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); |
| 156 } | 163 } |
| 157 } | 164 } |
| 158 AddSeparator(ui::NORMAL_SEPARATOR); | 165 AddSeparator(ui::NORMAL_SEPARATOR); |
| 159 if (item_.type == ash::TYPE_APP_SHORTCUT || | 166 if (item_.type == ash::TYPE_APP_SHORTCUT || |
| 160 item_.type == ash::TYPE_WINDOWED_APP || | 167 item_.type == ash::TYPE_WINDOWED_APP || |
| 161 item_.type == ash::TYPE_PLATFORM_APP) { | 168 item_.type == ash::TYPE_PLATFORM_APP) { |
| 162 const extensions::MenuItem::ExtensionKey app_key( | 169 const extensions::MenuItem::ExtensionKey app_key( |
| 163 controller_->GetAppIDForShelfID(item_.id)); | 170 controller_->GetAppIDForShelfID(item_.id)); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 case MENU_CHANGE_WALLPAPER: | 337 case MENU_CHANGE_WALLPAPER: |
| 331 ash::Shell::GetInstance()->user_wallpaper_delegate()-> | 338 ash::Shell::GetInstance()->user_wallpaper_delegate()-> |
| 332 OpenSetWallpaperPage(); | 339 OpenSetWallpaperPage(); |
| 333 break; | 340 break; |
| 334 #endif | 341 #endif |
| 335 default: | 342 default: |
| 336 extension_items_->ExecuteCommand(command_id, NULL, | 343 extension_items_->ExecuteCommand(command_id, NULL, |
| 337 content::ContextMenuParams()); | 344 content::ContextMenuParams()); |
| 338 } | 345 } |
| 339 } | 346 } |
| OLD | NEW |