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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 AddSeparator(ui::SPACING_SEPARATOR); | 467 AddSeparator(ui::SPACING_SEPARATOR); |
468 #endif | 468 #endif |
469 | 469 |
470 AddItemWithStringId(IDC_NEW_TAB, IDS_NEW_TAB); | 470 AddItemWithStringId(IDC_NEW_TAB, IDS_NEW_TAB); |
471 #if defined(OS_WIN) | 471 #if defined(OS_WIN) |
472 if (win8::IsSingleWindowMetroMode()) { | 472 if (win8::IsSingleWindowMetroMode()) { |
473 // In Win8's single window Metro mode, we only show the New Window options | 473 // In Win8's single window Metro mode, we only show the New Window options |
474 // if there isn't already a window of the requested type (incognito or not) | 474 // if there isn't already a window of the requested type (incognito or not) |
475 // that is available. | 475 // that is available. |
476 if (browser_->profile()->IsOffTheRecord()) { | 476 if (browser_->profile()->IsOffTheRecord()) { |
477 if (browser::FindBrowserWithProfile( | 477 if (chrome::FindBrowserWithProfile( |
478 browser_->profile()->GetOriginalProfile(), | 478 browser_->profile()->GetOriginalProfile(), |
479 browser_->host_desktop_type()) == NULL) { | 479 browser_->host_desktop_type()) == NULL) { |
480 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); | 480 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); |
481 } | 481 } |
482 } else if (!browser_->profile()->HasOffTheRecordProfile()) { | 482 } else if (!browser_->profile()->HasOffTheRecordProfile()) { |
483 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); | 483 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); |
484 } | 484 } |
485 } else { | 485 } else { |
486 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); | 486 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); |
487 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); | 487 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 zoom_label_ = l10n_util::GetStringFUTF16( | 718 zoom_label_ = l10n_util::GetStringFUTF16( |
719 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 719 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
720 } | 720 } |
721 | 721 |
722 string16 WrenchMenuModel::GetSyncMenuLabel() const { | 722 string16 WrenchMenuModel::GetSyncMenuLabel() const { |
723 Profile* profile = browser_->profile()->GetOriginalProfile(); | 723 Profile* profile = browser_->profile()->GetOriginalProfile(); |
724 return sync_ui_util::GetSyncMenuLabel( | 724 return sync_ui_util::GetSyncMenuLabel( |
725 ProfileSyncServiceFactory::GetForProfile(profile), | 725 ProfileSyncServiceFactory::GetForProfile(profile), |
726 *SigninManagerFactory::GetForProfile(profile)); | 726 *SigninManagerFactory::GetForProfile(profile)); |
727 } | 727 } |
OLD | NEW |