Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: chrome/browser/ui/ash/launcher/launcher_context_menu.cc

Issue 1611463002: Remove the close button in context menu for IME menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 add_close_item = true;
155 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); 155 #if defined(OS_CHROMEOS)
stevenjb 2016/01/20 18:03:29 Is there any reason why this needs to be OS_CHROME
Azure Wei 2016/01/21 04:44:54 The IME menu extensions are for Chrome OS only, so
156 // Remove the close item of IME menu in the IME extensions.
157 for (const char* id : extension_misc::kIMEExtensionIds) {
158 if (controller_->GetAppIDForShelfID(item_.id) == id) {
159 add_close_item = false;
160 }
161 }
stevenjb 2016/01/20 18:03:29 This logic really shouldn't be here. We should cre
Azure Wei 2016/01/21 04:44:54 Done.
162 #endif
163 if (add_close_item) {
164 AddItem(MENU_CLOSE,
165 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE));
166 }
156 } 167 }
157 } 168 }
158 AddSeparator(ui::NORMAL_SEPARATOR); 169 AddSeparator(ui::NORMAL_SEPARATOR);
159 if (item_.type == ash::TYPE_APP_SHORTCUT || 170 if (item_.type == ash::TYPE_APP_SHORTCUT ||
160 item_.type == ash::TYPE_WINDOWED_APP || 171 item_.type == ash::TYPE_WINDOWED_APP ||
161 item_.type == ash::TYPE_PLATFORM_APP) { 172 item_.type == ash::TYPE_PLATFORM_APP) {
162 const extensions::MenuItem::ExtensionKey app_key( 173 const extensions::MenuItem::ExtensionKey app_key(
163 controller_->GetAppIDForShelfID(item_.id)); 174 controller_->GetAppIDForShelfID(item_.id));
164 if (!app_key.empty()) { 175 if (!app_key.empty()) {
165 int index = 0; 176 int index = 0;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 case MENU_CHANGE_WALLPAPER: 341 case MENU_CHANGE_WALLPAPER:
331 ash::Shell::GetInstance()->user_wallpaper_delegate()-> 342 ash::Shell::GetInstance()->user_wallpaper_delegate()->
332 OpenSetWallpaperPage(); 343 OpenSetWallpaperPage();
333 break; 344 break;
334 #endif 345 #endif
335 default: 346 default:
336 extension_items_->ExecuteCommand(command_id, NULL, 347 extension_items_->ExecuteCommand(command_id, NULL,
337 content::ContextMenuParams()); 348 content::ContextMenuParams());
338 } 349 }
339 } 350 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/extension_constants.h » ('j') | chrome/common/extensions/extension_constants.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698