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

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

Issue 675023002: Make extensions that desire to act pop out if in overflow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Peter's Created 6 years, 1 month 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
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/wrench_menu_model.h" 5 #include "chrome/browser/ui/toolbar/wrench_menu_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 } 704 }
705 } 705 }
706 706
707 void WrenchMenuModel::CreateExtensionToolbarOverflowMenu() { 707 void WrenchMenuModel::CreateExtensionToolbarOverflowMenu() {
708 #if defined(TOOLKIT_VIEWS) 708 #if defined(TOOLKIT_VIEWS)
709 AddItem(IDC_EXTENSIONS_OVERFLOW_MENU, base::string16()); 709 AddItem(IDC_EXTENSIONS_OVERFLOW_MENU, base::string16());
710 // We only add the separator if there are > 0 items to show in the overflow. 710 // We only add the separator if there are > 0 items to show in the overflow.
711 extensions::ExtensionToolbarModel* toolbar_model = 711 extensions::ExtensionToolbarModel* toolbar_model =
712 extensions::ExtensionToolbarModel::Get(browser_->profile()); 712 extensions::ExtensionToolbarModel::Get(browser_->profile());
713 // A count of -1 means all actions are visible. 713 // A count of -1 means all actions are visible.
714 if (toolbar_model->GetVisibleIconCount() != -1) 714 if (!toolbar_model->all_icons_visible())
715 AddSeparator(ui::UPPER_SEPARATOR); 715 AddSeparator(ui::UPPER_SEPARATOR);
716 #endif // defined(TOOLKIT_VIEWS) 716 #endif // defined(TOOLKIT_VIEWS)
717 } 717 }
718 718
719 void WrenchMenuModel::CreateCutCopyPasteMenu() { 719 void WrenchMenuModel::CreateCutCopyPasteMenu() {
720 AddSeparator(ui::LOWER_SEPARATOR); 720 AddSeparator(ui::LOWER_SEPARATOR);
721 721
722 #if defined(OS_POSIX) && !defined(TOOLKIT_VIEWS) 722 #if defined(OS_POSIX) && !defined(TOOLKIT_VIEWS)
723 // WARNING: Mac does not use the ButtonMenuItemModel, but instead defines the 723 // WARNING: Mac does not use the ButtonMenuItemModel, but instead defines the
724 // layout for this menu item in Toolbar.xib. It does, however, use the 724 // layout for this menu item in Toolbar.xib. It does, however, use the
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 ->GetZoomPercent(); 778 ->GetZoomPercent();
779 } 779 }
780 zoom_label_ = l10n_util::GetStringFUTF16( 780 zoom_label_ = l10n_util::GetStringFUTF16(
781 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); 781 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent));
782 } 782 }
783 783
784 void WrenchMenuModel::OnZoomLevelChanged( 784 void WrenchMenuModel::OnZoomLevelChanged(
785 const content::HostZoomMap::ZoomLevelChange& change) { 785 const content::HostZoomMap::ZoomLevelChange& change) {
786 UpdateZoomControls(); 786 UpdateZoomControls();
787 } 787 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698