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

Side by Side Diff: chrome/browser/ui/toolbar/action_box_menu_model.cc

Issue 10837317: Setting the touch wrench menu as default menu for ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed build problems 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/toolbar/action_box_menu_model.h" 5 #include "chrome/browser/ui/toolbar/action_box_menu_model.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/extensions/extension_toolbar_model.h" 9 #include "chrome/browser/extensions/extension_toolbar_model.h"
10 #include "grit/generated_resources.h" 10 #include "grit/generated_resources.h"
(...skipping 22 matching lines...) Expand all
33 InsertItemWithStringIdAt(0, IDC_CHROME_TO_MOBILE_PAGE, 33 InsertItemWithStringIdAt(0, IDC_CHROME_TO_MOBILE_PAGE,
34 IDS_CHROME_TO_MOBILE_BUBBLE_TOOLTIP); 34 IDS_CHROME_TO_MOBILE_BUBBLE_TOOLTIP);
35 SetIcon(0, *rb.GetImageSkiaNamed(IDR_MOBILE)); 35 SetIcon(0, *rb.GetImageSkiaNamed(IDR_MOBILE));
36 InsertItemWithStringIdAt(1, IDC_BOOKMARK_PAGE, IDS_BOOKMARK_STAR); 36 InsertItemWithStringIdAt(1, IDC_BOOKMARK_PAGE, IDS_BOOKMARK_STAR);
37 SetIcon(1, *rb.GetImageSkiaNamed(IDR_STAR)); 37 SetIcon(1, *rb.GetImageSkiaNamed(IDR_STAR));
38 38
39 // Adds extensions to the model. 39 // Adds extensions to the model.
40 int command_id = kFirstExtensionCommandId; 40 int command_id = kFirstExtensionCommandId;
41 const extensions::ExtensionList& action_box_items = action_box_menu_items(); 41 const extensions::ExtensionList& action_box_items = action_box_menu_items();
42 if (!action_box_items.empty()) { 42 if (!action_box_items.empty()) {
43 AddSeparator(); 43 AddSeparator(ui::NORMAL_SEPARATOR);
44 for (size_t i = 0; i < action_box_items.size(); ++i) { 44 for (size_t i = 0; i < action_box_items.size(); ++i) {
45 const extensions::Extension* extension = action_box_items[i]; 45 const extensions::Extension* extension = action_box_items[i];
46 AddItem(command_id, UTF8ToUTF16(extension->name())); 46 AddItem(command_id, UTF8ToUTF16(extension->name()));
47 id_to_extension_id_map_[command_id++] = extension->id(); 47 id_to_extension_id_map_[command_id++] = extension->id();
48 } 48 }
49 } 49 }
50 } 50 }
51 51
52 ActionBoxMenuModel::~ActionBoxMenuModel() { 52 ActionBoxMenuModel::~ActionBoxMenuModel() {
53 // Ensures parent destructor does not use a partially destroyed delegate. 53 // Ensures parent destructor does not use a partially destroyed delegate.
(...skipping 16 matching lines...) Expand all
70 70
71 void ActionBoxMenuModel::ExecuteCommand(int command_id) { 71 void ActionBoxMenuModel::ExecuteCommand(int command_id) {
72 if (command_id < kFirstExtensionCommandId) 72 if (command_id < kFirstExtensionCommandId)
73 chrome::ExecuteCommand(browser_, command_id); 73 chrome::ExecuteCommand(browser_, command_id);
74 } 74 }
75 75
76 void ActionBoxMenuModel::Observe(int type, 76 void ActionBoxMenuModel::Observe(int type,
77 const content::NotificationSource& source, 77 const content::NotificationSource& source,
78 const content::NotificationDetails& details) { 78 const content::NotificationDetails& details) {
79 } 79 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698