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

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

Issue 1919593003: arc: Prevent showing Opt-in UI when it is not expected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TODO added Created 4 years, 7 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 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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698