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

Side by Side Diff: chrome/browser/ui/app_list/app_context_menu.cc

Issue 329383003: Disable the App Info Dialog from displaying for the Genius app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switched to a special case instead of making it the norm Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/app_list/app_context_menu.h" 5 #include "chrome/browser/ui/app_list/app_context_menu.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/chromeos/genius_app/app_id.h"
10 #include "chrome/browser/extensions/context_menu_matcher.h" 11 #include "chrome/browser/extensions/context_menu_matcher.h"
11 #include "chrome/browser/extensions/menu_manager.h" 12 #include "chrome/browser/extensions/menu_manager.h"
12 #include "chrome/browser/prefs/incognito_mode_prefs.h" 13 #include "chrome/browser/prefs/incognito_mode_prefs.h"
13 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/ui/app_list/app_context_menu_delegate.h" 15 #include "chrome/browser/ui/app_list/app_context_menu_delegate.h"
15 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" 16 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
16 #include "chrome/common/chrome_switches.h" 17 #include "chrome/common/chrome_switches.h"
17 #include "chrome/common/extensions/extension_constants.h" 18 #include "chrome/common/extensions/extension_constants.h"
18 #include "chrome/common/extensions/manifest_url_handler.h" 19 #include "chrome/common/extensions/manifest_url_handler.h"
19 #include "content/public/common/context_menu_params.h" 20 #include "content/public/common/context_menu_params.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 controller_->IsAppPinned(app_id_) ? 110 controller_->IsAppPinned(app_id_) ?
110 IDS_APP_LIST_CONTEXT_MENU_UNPIN : 111 IDS_APP_LIST_CONTEXT_MENU_UNPIN :
111 IDS_APP_LIST_CONTEXT_MENU_PIN); 112 IDS_APP_LIST_CONTEXT_MENU_PIN);
112 } 113 }
113 114
114 if (controller_->CanDoCreateShortcutsFlow()) { 115 if (controller_->CanDoCreateShortcutsFlow()) {
115 menu_model_->AddItemWithStringId(CREATE_SHORTCUTS, 116 menu_model_->AddItemWithStringId(CREATE_SHORTCUTS,
116 IDS_NEW_TAB_APP_CREATE_SHORTCUT); 117 IDS_NEW_TAB_APP_CREATE_SHORTCUT);
117 } 118 }
118 119
119 // Don't display the app info dialog for the web store app. 120 // Don't display the app info dialog for the Store app or the Genius app.
121 // TODO(sashab): Update the metadata for these apps so their dialogs can be
benwells 2014/06/12 07:11:14 Nit: you should update the bug to describe this an
122 // re-enabled.
120 if (controller_->CanDoShowAppInfoFlow() && 123 if (controller_->CanDoShowAppInfoFlow() &&
121 app_id_ != extension_misc::kWebStoreAppId) { 124 app_id_ != extension_misc::kWebStoreAppId &&
125 app_id_ != genius_app::kGeniusAppId) {
122 menu_model_->AddItemWithStringId(SHOW_APP_INFO, 126 menu_model_->AddItemWithStringId(SHOW_APP_INFO,
123 IDS_APP_CONTEXT_MENU_SHOW_INFO); 127 IDS_APP_CONTEXT_MENU_SHOW_INFO);
124 } 128 }
125 129
126 if (!is_platform_app_) { 130 if (!is_platform_app_) {
127 menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); 131 menu_model_->AddSeparator(ui::NORMAL_SEPARATOR);
128 // Streamlined hosted apps can only toggle between USE_LAUNCH_TYPE_WINDOW 132 // Streamlined hosted apps can only toggle between USE_LAUNCH_TYPE_WINDOW
129 // and USE_LAUNCH_TYPE_REGULAR. 133 // and USE_LAUNCH_TYPE_REGULAR.
130 if (CommandLine::ForCurrentProcess()->HasSwitch( 134 if (CommandLine::ForCurrentProcess()->HasSwitch(
131 switches::kEnableStreamlinedHostedApps)) { 135 switches::kEnableStreamlinedHostedApps)) {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 extension_menu_items_->ExecuteCommand(command_id, NULL, 280 extension_menu_items_->ExecuteCommand(command_id, NULL,
277 content::ContextMenuParams()); 281 content::ContextMenuParams());
278 } else if (command_id == MENU_NEW_WINDOW) { 282 } else if (command_id == MENU_NEW_WINDOW) {
279 controller_->CreateNewWindow(profile_, false); 283 controller_->CreateNewWindow(profile_, false);
280 } else if (command_id == MENU_NEW_INCOGNITO_WINDOW) { 284 } else if (command_id == MENU_NEW_INCOGNITO_WINDOW) {
281 controller_->CreateNewWindow(profile_, true); 285 controller_->CreateNewWindow(profile_, true);
282 } 286 }
283 } 287 }
284 288
285 } // namespace app_list 289 } // namespace app_list
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698