OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/wrench_menu_model.h" | 5 #include "chrome/browser/wrench_menu_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 AddItemWithStringId(IDC_SHOW_HISTORY, IDS_SHOW_HISTORY); | 248 AddItemWithStringId(IDC_SHOW_HISTORY, IDS_SHOW_HISTORY); |
249 AddItemWithStringId(IDC_SHOW_DOWNLOADS, IDS_SHOW_DOWNLOADS); | 249 AddItemWithStringId(IDC_SHOW_DOWNLOADS, IDS_SHOW_DOWNLOADS); |
250 AddSeparator(); | 250 AddSeparator(); |
251 | 251 |
252 #if defined(OS_MACOSX) | 252 #if defined(OS_MACOSX) |
253 AddItemWithStringId(IDC_OPTIONS, IDS_PREFERENCES_MAC); | 253 AddItemWithStringId(IDC_OPTIONS, IDS_PREFERENCES_MAC); |
254 #else | 254 #else |
255 AddItemWithStringId(IDC_OPTIONS, IDS_OPTIONS); | 255 AddItemWithStringId(IDC_OPTIONS, IDS_OPTIONS); |
256 #endif | 256 #endif |
257 | 257 |
258 if (browser_defaults::kShowAboutMenuItem) { | 258 // On Mac, there is no About item unless it is replaced with the update |
| 259 // available notification. |
| 260 if (browser_defaults::kShowAboutMenuItem || |
| 261 Singleton<UpgradeDetector>::get()->notify_upgrade()) { |
259 AddItem(IDC_ABOUT, | 262 AddItem(IDC_ABOUT, |
260 l10n_util::GetStringFUTF16( | 263 l10n_util::GetStringFUTF16( |
261 IDS_ABOUT, | 264 IDS_ABOUT, |
262 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | 265 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
263 } | 266 } |
264 AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE); | 267 AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE); |
265 if (browser_defaults::kShowExitMenuItem) { | 268 if (browser_defaults::kShowExitMenuItem) { |
266 AddSeparator(); | 269 AddSeparator(); |
267 #if defined(OS_CHROMEOS) | 270 #if defined(OS_CHROMEOS) |
268 AddItemWithStringId(IDC_EXIT, IDS_SIGN_OUT); | 271 AddItemWithStringId(IDC_EXIT, IDS_SIGN_OUT); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 } | 331 } |
329 return l10n_util::GetStringFUTF16( | 332 return l10n_util::GetStringFUTF16( |
330 IDS_ABOUT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 333 IDS_ABOUT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
331 } | 334 } |
332 | 335 |
333 bool WrenchMenuModel::IsDynamicItem(int index) const { | 336 bool WrenchMenuModel::IsDynamicItem(int index) const { |
334 int command_id = GetCommandIdAt(index); | 337 int command_id = GetCommandIdAt(index); |
335 return command_id == IDC_SYNC_BOOKMARKS || | 338 return command_id == IDC_SYNC_BOOKMARKS || |
336 command_id == IDC_ABOUT; | 339 command_id == IDC_ABOUT; |
337 } | 340 } |
OLD | NEW |