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

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

Issue 459493002: Revert of Extend contextMenus API to support browser/page actions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 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/browser/extensions/context_menu_matcher.h" 9 #include "chrome/browser/extensions/context_menu_matcher.h"
10 #include "chrome/browser/extensions/menu_manager.h" 10 #include "chrome/browser/extensions/menu_manager.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 USE_LAUNCH_TYPE_FULLSCREEN, 145 USE_LAUNCH_TYPE_FULLSCREEN,
146 IDS_APP_CONTEXT_MENU_OPEN_MAXIMIZED); 146 IDS_APP_CONTEXT_MENU_OPEN_MAXIMIZED);
147 #endif 147 #endif
148 } 148 }
149 menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); 149 menu_model_->AddSeparator(ui::NORMAL_SEPARATOR);
150 } 150 }
151 151
152 // Assign unique IDs to commands added by the app itself. 152 // Assign unique IDs to commands added by the app itself.
153 int index = USE_LAUNCH_TYPE_COMMAND_END; 153 int index = USE_LAUNCH_TYPE_COMMAND_END;
154 extension_menu_items_->AppendExtensionItems( 154 extension_menu_items_->AppendExtensionItems(
155 extensions::MenuItem::ExtensionKey(app_id_), 155 extensions::MenuItem::ExtensionKey(app_id_), base::string16(), &index);
156 base::string16(),
157 &index,
158 false); // is_action_menu
159 156
160 // If at least 1 item was added, add another separator after the list. 157 // If at least 1 item was added, add another separator after the list.
161 if (index > USE_LAUNCH_TYPE_COMMAND_END) 158 if (index > USE_LAUNCH_TYPE_COMMAND_END)
162 menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); 159 menu_model_->AddSeparator(ui::NORMAL_SEPARATOR);
163 160
164 if (!is_platform_app_) 161 if (!is_platform_app_)
165 menu_model_->AddItemWithStringId(OPTIONS, IDS_NEW_TAB_APP_OPTIONS); 162 menu_model_->AddItemWithStringId(OPTIONS, IDS_NEW_TAB_APP_OPTIONS);
166 163
167 menu_model_->AddItemWithStringId(UNINSTALL, 164 menu_model_->AddItemWithStringId(UNINSTALL,
168 is_platform_app_ 165 is_platform_app_
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 extension_menu_items_->ExecuteCommand(command_id, NULL, 278 extension_menu_items_->ExecuteCommand(command_id, NULL,
282 content::ContextMenuParams()); 279 content::ContextMenuParams());
283 } else if (command_id == MENU_NEW_WINDOW) { 280 } else if (command_id == MENU_NEW_WINDOW) {
284 controller_->CreateNewWindow(profile_, false); 281 controller_->CreateNewWindow(profile_, false);
285 } else if (command_id == MENU_NEW_INCOGNITO_WINDOW) { 282 } else if (command_id == MENU_NEW_INCOGNITO_WINDOW) {
286 controller_->CreateNewWindow(profile_, true); 283 controller_->CreateNewWindow(profile_, true);
287 } 284 }
288 } 285 }
289 286
290 } // namespace app_list 287 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698