Chromium Code Reviews| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 if (controller_->IsOpen(item_.id)) { |
| 154 AddItem(MENU_CLOSE, | 154 bool show_close_button = true; |
|
stevenjb
2016/01/29 17:53:27
nit (sorry, I didn't notice this before) this coul
Azure Wei
2016/01/30 09:04:13
Done. Thank you for pointing this out.
| |
| 155 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); | 155 #if defined(OS_CHROMEOS) |
| 156 if (extension_misc::IsImeMenuExtensionId( | |
| 157 controller_->GetAppIDForShelfID(item_.id))) | |
| 158 show_close_button = false; | |
|
stevenjb
2016/01/29 17:53:27
nit: {}
Azure Wei
2016/01/30 09:04:13
Done.
| |
| 159 #endif | |
| 160 if (show_close_button) | |
| 161 AddItem(MENU_CLOSE, | |
| 162 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); | |
|
stevenjb
2016/01/29 17:53:27
{}
Azure Wei
2016/01/30 09:04:13
Done.
| |
| 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)); |
| 164 if (!app_key.empty()) { | 171 if (!app_key.empty()) { |
| 165 int index = 0; | 172 int index = 0; |
| (...skipping 164 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 |