| 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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |