OLD | NEW |
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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 } | 1030 } |
1031 | 1031 |
1032 void WrenchMenuModel::CreateExtensionToolbarOverflowMenu() { | 1032 void WrenchMenuModel::CreateExtensionToolbarOverflowMenu() { |
1033 // We only add the extensions overflow container if there are any icons that | 1033 // We only add the extensions overflow container if there are any icons that |
1034 // aren't shown in the main container or if there are component actions. | 1034 // aren't shown in the main container or if there are component actions. |
1035 // TODO(apacible): Remove check for component actions when | 1035 // TODO(apacible): Remove check for component actions when |
1036 // ExtensionToolbarModel can support them. | 1036 // ExtensionToolbarModel can support them. |
1037 if (!extensions::ExtensionToolbarModel::Get(browser_->profile())-> | 1037 if (!extensions::ExtensionToolbarModel::Get(browser_->profile())-> |
1038 all_icons_visible() || | 1038 all_icons_visible() || |
1039 ComponentToolbarActionsFactory::GetInstance()-> | 1039 ComponentToolbarActionsFactory::GetInstance()-> |
1040 GetNumComponentActions() > 0) { | 1040 GetNumComponentActions(browser_) > 0) { |
1041 #if defined(OS_MACOSX) | 1041 #if defined(OS_MACOSX) |
1042 // There's a bug in AppKit menus, where if a menu item with a custom view | 1042 // There's a bug in AppKit menus, where if a menu item with a custom view |
1043 // (like the extensions overflow menu) is the first menu item, it is not | 1043 // (like the extensions overflow menu) is the first menu item, it is not |
1044 // highlightable or keyboard-selectable. | 1044 // highlightable or keyboard-selectable. |
1045 // Adding any menu item before it (even one which is never visible) prevents | 1045 // Adding any menu item before it (even one which is never visible) prevents |
1046 // it, so add a bogus item here that will always be hidden. | 1046 // it, so add a bogus item here that will always be hidden. |
1047 AddItem(kEmptyMenuItemCommand, base::string16()); | 1047 AddItem(kEmptyMenuItemCommand, base::string16()); |
1048 #endif | 1048 #endif |
1049 AddItem(IDC_EXTENSIONS_OVERFLOW_MENU, base::string16()); | 1049 AddItem(IDC_EXTENSIONS_OVERFLOW_MENU, base::string16()); |
1050 AddSeparator(ui::UPPER_SEPARATOR); | 1050 AddSeparator(ui::UPPER_SEPARATOR); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 ->GetZoomPercent(); | 1095 ->GetZoomPercent(); |
1096 } | 1096 } |
1097 zoom_label_ = l10n_util::GetStringFUTF16( | 1097 zoom_label_ = l10n_util::GetStringFUTF16( |
1098 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 1098 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
1099 } | 1099 } |
1100 | 1100 |
1101 void WrenchMenuModel::OnZoomLevelChanged( | 1101 void WrenchMenuModel::OnZoomLevelChanged( |
1102 const content::HostZoomMap::ZoomLevelChange& change) { | 1102 const content::HostZoomMap::ZoomLevelChange& change) { |
1103 UpdateZoomControls(); | 1103 UpdateZoomControls(); |
1104 } | 1104 } |
OLD | NEW |