OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 } | 96 } |
97 } | 97 } |
98 | 98 |
99 bool EncodingMenuModel::IsCommandIdChecked(int command_id) const { | 99 bool EncodingMenuModel::IsCommandIdChecked(int command_id) const { |
100 TabContents* current_tab = browser_->GetSelectedTabContents(); | 100 TabContents* current_tab = browser_->GetSelectedTabContents(); |
101 if (!current_tab) | 101 if (!current_tab) |
102 return false; | 102 return false; |
103 EncodingMenuController controller; | 103 EncodingMenuController controller; |
104 return controller.IsItemChecked(browser_->profile(), | 104 return controller.IsItemChecked(browser_->profile(), |
105 current_tab->encoding(), command_id); | 105 current_tab->GetEncoding(), command_id); |
106 } | 106 } |
107 | 107 |
108 bool EncodingMenuModel::IsCommandIdEnabled(int command_id) const { | 108 bool EncodingMenuModel::IsCommandIdEnabled(int command_id) const { |
109 bool enabled = browser_->command_updater()->IsCommandEnabled(command_id); | 109 bool enabled = browser_->command_updater()->IsCommandEnabled(command_id); |
110 // Special handling for the contents of the Encoding submenu. On Mac OS, | 110 // Special handling for the contents of the Encoding submenu. On Mac OS, |
111 // instead of enabling/disabling the top-level menu item, the submenu's | 111 // instead of enabling/disabling the top-level menu item, the submenu's |
112 // contents get disabled, per Apple's HIG. | 112 // contents get disabled, per Apple's HIG. |
113 #if defined(OS_MACOSX) | 113 #if defined(OS_MACOSX) |
114 enabled &= browser_->command_updater()->IsCommandEnabled(IDC_ENCODING_MENU); | 114 enabled &= browser_->command_updater()->IsCommandEnabled(IDC_ENCODING_MENU); |
115 #endif | 115 #endif |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 &enable_increment, &enable_decrement); | 594 &enable_increment, &enable_decrement); |
595 } | 595 } |
596 zoom_label_ = l10n_util::GetStringFUTF16( | 596 zoom_label_ = l10n_util::GetStringFUTF16( |
597 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 597 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
598 } | 598 } |
599 | 599 |
600 string16 WrenchMenuModel::GetSyncMenuLabel() const { | 600 string16 WrenchMenuModel::GetSyncMenuLabel() const { |
601 return sync_ui_util::GetSyncMenuLabel( | 601 return sync_ui_util::GetSyncMenuLabel( |
602 browser_->profile()->GetOriginalProfile()->GetProfileSyncService()); | 602 browser_->profile()->GetOriginalProfile()->GetProfileSyncService()); |
603 } | 603 } |
OLD | NEW |