Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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, item)); | 1155 new ExtensionToolbarMenuView(browser_, this, item)); |
| 1156 if (!extension_toolbar->ShouldShow()) { | |
|
Devlin
2016/03/11 00:07:25
This should be unnecessary with ToolbarActionsBar:
| |
| 1157 item->SetVisible(false); | |
| 1158 extension_toolbar_ = nullptr; | |
| 1159 break; | |
| 1160 } | |
| 1161 if (ui::MaterialDesignController::IsModeMaterial()) { | 1156 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 1162 for (int i = 0; i < extension_toolbar->contents()->child_count(); | 1157 for (int i = 0; i < extension_toolbar->contents()->child_count(); |
| 1163 ++i) { | 1158 ++i) { |
| 1164 View* action_view = extension_toolbar->contents()->child_at(i); | 1159 View* action_view = extension_toolbar->contents()->child_at(i); |
| 1165 action_view->set_background(new InMenuButtonBackground( | 1160 action_view->set_background(new InMenuButtonBackground( |
| 1166 InMenuButtonBackground::ROUNDED_BUTTON)); | 1161 InMenuButtonBackground::ROUNDED_BUTTON)); |
| 1167 } | 1162 } |
| 1168 } | 1163 } |
| 1169 extension_toolbar_ = extension_toolbar.get(); | 1164 extension_toolbar_ = extension_toolbar.get(); |
| 1170 item->AddChildView(extension_toolbar.release()); | 1165 item->AddChildView(extension_toolbar.release()); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1292 0, | 1287 0, |
| 1293 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, | 1288 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, |
| 1294 BOOKMARK_LAUNCH_LOCATION_WRENCH_MENU); | 1289 BOOKMARK_LAUNCH_LOCATION_WRENCH_MENU); |
| 1295 } | 1290 } |
| 1296 | 1291 |
| 1297 int AppMenu::ModelIndexFromCommandId(int command_id) const { | 1292 int AppMenu::ModelIndexFromCommandId(int command_id) const { |
| 1298 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); | 1293 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); |
| 1299 DCHECK(ix != command_id_to_entry_.end()); | 1294 DCHECK(ix != command_id_to_entry_.end()); |
| 1300 return ix->second.second; | 1295 return ix->second.second; |
| 1301 } | 1296 } |
| OLD | NEW |