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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); | 494 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); |
495 #if defined(OS_CHROMEOS) | 495 #if defined(OS_CHROMEOS) |
496 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) | 496 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) |
497 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); | 497 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); |
498 #else | 498 #else |
499 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); | 499 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); |
500 #endif | 500 #endif |
501 | 501 |
502 #endif // else of defined(OS_WIN) | 502 #endif // else of defined(OS_WIN) |
503 | 503 |
504 #if defined(USE_ASH) | 504 #if defined(USE_AURA) && defined(OS_WIN) |
505 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAsh)) { | 505 if (!ash::Shell::HasInstance()) |
506 if (!ash::Shell::HasInstance()) | 506 AddItemWithStringId(IDC_TOGGLE_ASH_DESKTOP, IDS_OPEN_ASH_DESKTOP); |
507 AddItemWithStringId(IDC_TOGGLE_ASH_DESKTOP, IDS_OPEN_ASH_DESKTOP); | 507 else |
508 else | 508 AddItemWithStringId(IDC_TOGGLE_ASH_DESKTOP, IDS_CLOSE_ASH_DESKTOP); |
509 AddItemWithStringId(IDC_TOGGLE_ASH_DESKTOP, IDS_CLOSE_ASH_DESKTOP); | |
510 } | |
511 #endif | 509 #endif |
512 | 510 |
513 bookmark_sub_menu_model_.reset(new BookmarkSubMenuModel(this, browser_)); | 511 bookmark_sub_menu_model_.reset(new BookmarkSubMenuModel(this, browser_)); |
514 AddSubMenuWithStringId(IDC_BOOKMARKS_MENU, IDS_BOOKMARKS_MENU, | 512 AddSubMenuWithStringId(IDC_BOOKMARKS_MENU, IDS_BOOKMARKS_MENU, |
515 bookmark_sub_menu_model_.get()); | 513 bookmark_sub_menu_model_.get()); |
516 | 514 |
517 #if defined(OS_WIN) | 515 #if defined(OS_WIN) |
518 if (base::win::IsMetroProcess()) { | 516 if (base::win::IsMetroProcess()) { |
519 // Metro mode, add the 'Relaunch Chrome in desktop mode'. | 517 // Metro mode, add the 'Relaunch Chrome in desktop mode'. |
520 AddSeparator(ui::SPACING_SEPARATOR); | 518 AddSeparator(ui::SPACING_SEPARATOR); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 zoom_label_ = l10n_util::GetStringFUTF16( | 717 zoom_label_ = l10n_util::GetStringFUTF16( |
720 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 718 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
721 } | 719 } |
722 | 720 |
723 string16 WrenchMenuModel::GetSyncMenuLabel() const { | 721 string16 WrenchMenuModel::GetSyncMenuLabel() const { |
724 Profile* profile = browser_->profile()->GetOriginalProfile(); | 722 Profile* profile = browser_->profile()->GetOriginalProfile(); |
725 return sync_ui_util::GetSyncMenuLabel( | 723 return sync_ui_util::GetSyncMenuLabel( |
726 ProfileSyncServiceFactory::GetForProfile(profile), | 724 ProfileSyncServiceFactory::GetForProfile(profile), |
727 *SigninManagerFactory::GetForProfile(profile)); | 725 *SigninManagerFactory::GetForProfile(profile)); |
728 } | 726 } |
OLD | NEW |