| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 HelpMenuModel(ui::SimpleMenuModel::Delegate* delegate, | 192 HelpMenuModel(ui::SimpleMenuModel::Delegate* delegate, |
| 193 Browser* browser) | 193 Browser* browser) |
| 194 : SimpleMenuModel(delegate) { | 194 : SimpleMenuModel(delegate) { |
| 195 Build(browser); | 195 Build(browser); |
| 196 } | 196 } |
| 197 virtual ~HelpMenuModel() { | 197 virtual ~HelpMenuModel() { |
| 198 } | 198 } |
| 199 | 199 |
| 200 private: | 200 private: |
| 201 void Build(Browser* browser) { | 201 void Build(Browser* browser) { |
| 202 #if defined(OS_CHROMEOS) && defined(OFFICIAL_BUILD) |
| 203 int help_string_id = IDS_GET_HELP; |
| 204 #else |
| 202 int help_string_id = IDS_HELP_PAGE; | 205 int help_string_id = IDS_HELP_PAGE; |
| 203 #if defined(OS_CHROMEOS) && defined(OFFICIAL_BUILD) | |
| 204 if (!CommandLine::ForCurrentProcess()->HasSwitch( | |
| 205 chromeos::switches::kDisableGeniusApp)) { | |
| 206 help_string_id = IDS_GET_HELP; | |
| 207 } | |
| 208 #endif | 206 #endif |
| 209 AddItemWithStringId(IDC_HELP_PAGE_VIA_MENU, help_string_id); | 207 AddItemWithStringId(IDC_HELP_PAGE_VIA_MENU, help_string_id); |
| 210 if (browser_defaults::kShowHelpMenuItemIcon) { | 208 if (browser_defaults::kShowHelpMenuItemIcon) { |
| 211 ui::ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 209 ui::ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 212 SetIcon(GetIndexOfCommandId(IDC_HELP_PAGE_VIA_MENU), | 210 SetIcon(GetIndexOfCommandId(IDC_HELP_PAGE_VIA_MENU), |
| 213 rb.GetNativeImageNamed(IDR_HELP_MENU)); | 211 rb.GetNativeImageNamed(IDR_HELP_MENU)); |
| 214 } | 212 } |
| 215 | 213 |
| 216 AddItemWithStringId(IDC_FEEDBACK, IDS_FEEDBACK); | 214 AddItemWithStringId(IDC_FEEDBACK, IDS_FEEDBACK); |
| 217 } | 215 } |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 ->GetZoomPercent(); | 783 ->GetZoomPercent(); |
| 786 } | 784 } |
| 787 zoom_label_ = l10n_util::GetStringFUTF16( | 785 zoom_label_ = l10n_util::GetStringFUTF16( |
| 788 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 786 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
| 789 } | 787 } |
| 790 | 788 |
| 791 void WrenchMenuModel::OnZoomLevelChanged( | 789 void WrenchMenuModel::OnZoomLevelChanged( |
| 792 const content::HostZoomMap::ZoomLevelChange& change) { | 790 const content::HostZoomMap::ZoomLevelChange& change) { |
| 793 UpdateZoomControls(); | 791 UpdateZoomControls(); |
| 794 } | 792 } |
| OLD | NEW |