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

Unified Diff: chrome/browser/ui/cocoa/location_bar/plus_decoration.mm

Issue 10823289: Adding "send to mobile" and "add bookmark" to the action box menu and wiring to their respective ac… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Applied review comments. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/toolbar/action_box_menu_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/plus_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/plus_decoration.mm b/chrome/browser/ui/cocoa/location_bar/plus_decoration.mm
index 8c5a8118a454eeba891239436610ab15c6592fc3..eca300968b8e30eea0de58904f0c29eba1775270 100644
--- a/chrome/browser/ui/cocoa/location_bar/plus_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/plus_decoration.mm
@@ -4,19 +4,18 @@
#import "chrome/browser/ui/cocoa/location_bar/plus_decoration.h"
-#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/command_updater.h"
+#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#import "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h"
#import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h"
#import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
#import "chrome/browser/ui/cocoa/menu_controller.h"
+#include "chrome/browser/ui/toolbar/action_box_menu_model.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util_mac.h"
-#include "ui/base/models/simple_menu_model.h"
-#include "ui/base/resource/resource_bundle.h"
namespace {
// The offset to apply to the menu so that it clears the bottom border of the
@@ -45,18 +44,9 @@ bool PlusDecoration::AcceptsMousePress() {
}
bool PlusDecoration::OnMousePressed(NSRect frame) {
- ui::SimpleMenuModel menu_model(NULL);
-
- ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
-
- // TODO(beaudoin): Use a platform-independent menu model once the Windows
- // patch introducing it lands. See: http://codereview.chromium.org/10533086/
- menu_model.InsertItemWithStringIdAt(0, IDC_CHROME_TO_MOBILE_PAGE,
- IDS_CHROME_TO_MOBILE);
- menu_model.SetIcon(0, *rb.GetImageSkiaNamed(IDR_MOBILE));
- menu_model.InsertItemWithStringIdAt(1, IDC_BOOKMARK_PAGE,
- IDS_BOOKMARK_STAR);
- menu_model.SetIcon(1, *rb.GetImageSkiaNamed(IDR_STAR));
+ ExtensionService* extension_service = extensions::ExtensionSystem::Get(
+ browser_->profile())->extension_service();
+ ActionBoxMenuModel menu_model(browser_, extension_service);
// Controller for the menu attached to the plus decoration.
scoped_nsobject<MenuController> menu_controller(
« no previous file with comments | « no previous file | chrome/browser/ui/toolbar/action_box_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698