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

Side by Side Diff: chrome/browser/ui/views/toolbar/app_menu.cc

Issue 1766023002: [Extensions UI Views] Adjust the wrench menu actions for items added/removed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.h » ('j') | 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/views/toolbar/app_menu.h" 5 #include "chrome/browser/ui/views/toolbar/app_menu.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 1145
1146 item->SetMargins(top_margin, bottom_margin); 1146 item->SetMargins(top_margin, bottom_margin);
1147 } 1147 }
1148 1148
1149 if (model->GetTypeAt(i) == MenuModel::TYPE_SUBMENU) 1149 if (model->GetTypeAt(i) == MenuModel::TYPE_SUBMENU)
1150 PopulateMenu(item, model->GetSubmenuModelAt(i)); 1150 PopulateMenu(item, model->GetSubmenuModelAt(i));
1151 1151
1152 switch (model->GetCommandIdAt(i)) { 1152 switch (model->GetCommandIdAt(i)) {
1153 case IDC_EXTENSIONS_OVERFLOW_MENU: { 1153 case IDC_EXTENSIONS_OVERFLOW_MENU: {
1154 scoped_ptr<ExtensionToolbarMenuView> extension_toolbar( 1154 scoped_ptr<ExtensionToolbarMenuView> extension_toolbar(
1155 new ExtensionToolbarMenuView(browser_, this)); 1155 new ExtensionToolbarMenuView(browser_, this, item));
1156 if (!extension_toolbar->ShouldShow()) { 1156 if (!extension_toolbar->ShouldShow()) {
1157 item->SetVisible(false); 1157 item->SetVisible(false);
1158 extension_toolbar_ = nullptr; 1158 extension_toolbar_ = nullptr;
1159 break; 1159 break;
1160 } 1160 }
1161 if (ui::MaterialDesignController::IsModeMaterial()) { 1161 if (ui::MaterialDesignController::IsModeMaterial()) {
1162 for (int i = 0; i < extension_toolbar->contents()->child_count(); 1162 for (int i = 0; i < extension_toolbar->contents()->child_count();
1163 ++i) { 1163 ++i) {
1164 View* action_view = extension_toolbar->contents()->child_at(i); 1164 View* action_view = extension_toolbar->contents()->child_at(i);
1165 action_view->set_background(new InMenuButtonBackground( 1165 action_view->set_background(new InMenuButtonBackground(
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 0, 1292 0,
1293 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, 1293 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS,
1294 BOOKMARK_LAUNCH_LOCATION_WRENCH_MENU); 1294 BOOKMARK_LAUNCH_LOCATION_WRENCH_MENU);
1295 } 1295 }
1296 1296
1297 int AppMenu::ModelIndexFromCommandId(int command_id) const { 1297 int AppMenu::ModelIndexFromCommandId(int command_id) const {
1298 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); 1298 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id);
1299 DCHECK(ix != command_id_to_entry_.end()); 1299 DCHECK(ix != command_id_to_entry_.end());
1300 return ix->second.second; 1300 return ix->second.second;
1301 } 1301 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698