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

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

Issue 556293003: Allow the user to drag an extension to the overflow menu, even when its empty (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.cc ('k') | 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/views/toolbar/wrench_menu.h" 5 #include "chrome/browser/ui/views/toolbar/wrench_menu.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <set> 9 #include <set>
10 10
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 item->SetMargins(top_margin, bottom_margin); 1130 item->SetMargins(top_margin, bottom_margin);
1131 } 1131 }
1132 1132
1133 if (model->GetTypeAt(i) == MenuModel::TYPE_SUBMENU) 1133 if (model->GetTypeAt(i) == MenuModel::TYPE_SUBMENU)
1134 PopulateMenu(item, model->GetSubmenuModelAt(i)); 1134 PopulateMenu(item, model->GetSubmenuModelAt(i));
1135 1135
1136 switch (model->GetCommandIdAt(i)) { 1136 switch (model->GetCommandIdAt(i)) {
1137 case IDC_EXTENSIONS_OVERFLOW_MENU: { 1137 case IDC_EXTENSIONS_OVERFLOW_MENU: {
1138 scoped_ptr<ExtensionToolbarMenuView> extension_toolbar( 1138 scoped_ptr<ExtensionToolbarMenuView> extension_toolbar(
1139 new ExtensionToolbarMenuView(browser_, this)); 1139 new ExtensionToolbarMenuView(browser_, this));
1140 if (extension_toolbar->GetPreferredSize().height() > 0) 1140 if (extension_toolbar->ShouldShow())
1141 item->AddChildView(extension_toolbar.release()); 1141 item->AddChildView(extension_toolbar.release());
1142 else 1142 else
1143 item->SetVisible(false); 1143 item->SetVisible(false);
1144 break; 1144 break;
1145 } 1145 }
1146 1146
1147 case IDC_CUT: 1147 case IDC_CUT:
1148 DCHECK_EQ(MenuModel::TYPE_COMMAND, model->GetTypeAt(i)); 1148 DCHECK_EQ(MenuModel::TYPE_COMMAND, model->GetTypeAt(i));
1149 DCHECK_LT(i + 2, max); 1149 DCHECK_LT(i + 2, max);
1150 DCHECK_EQ(IDC_COPY, model->GetCommandIdAt(i + 1)); 1150 DCHECK_EQ(IDC_COPY, model->GetCommandIdAt(i + 1));
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 0, 1261 0,
1262 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, 1262 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS,
1263 BOOKMARK_LAUNCH_LOCATION_WRENCH_MENU); 1263 BOOKMARK_LAUNCH_LOCATION_WRENCH_MENU);
1264 } 1264 }
1265 1265
1266 int WrenchMenu::ModelIndexFromCommandId(int command_id) const { 1266 int WrenchMenu::ModelIndexFromCommandId(int command_id) const {
1267 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); 1267 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id);
1268 DCHECK(ix != command_id_to_entry_.end()); 1268 DCHECK(ix != command_id_to_entry_.end());
1269 return ix->second.second; 1269 return ix->second.second;
1270 } 1270 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698