| 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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); | 490 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); |
| 491 #if defined(OS_CHROMEOS) | 491 #if defined(OS_CHROMEOS) |
| 492 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) | 492 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) |
| 493 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); | 493 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); |
| 494 #else | 494 #else |
| 495 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); | 495 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); |
| 496 #endif | 496 #endif |
| 497 | 497 |
| 498 #endif // else of defined(OS_WIN) | 498 #endif // else of defined(OS_WIN) |
| 499 | 499 |
| 500 AddItemWithStringId(IDC_PIN_TO_START_SCREEN, IDS_PIN_TO_START_SCREEN); | |
| 501 bookmark_sub_menu_model_.reset(new BookmarkSubMenuModel(this, browser_)); | 500 bookmark_sub_menu_model_.reset(new BookmarkSubMenuModel(this, browser_)); |
| 502 AddSubMenuWithStringId(IDC_BOOKMARKS_MENU, IDS_BOOKMARKS_MENU, | 501 AddSubMenuWithStringId(IDC_BOOKMARKS_MENU, IDS_BOOKMARKS_MENU, |
| 503 bookmark_sub_menu_model_.get()); | 502 bookmark_sub_menu_model_.get()); |
| 504 | 503 |
| 505 #if defined(OS_WIN) | 504 #if defined(OS_WIN) |
| 506 if (base::win::IsMetroProcess()) { | 505 if (base::win::IsMetroProcess()) { |
| 507 // Metro mode, add the 'Relaunch Chrome in desktop mode'. | 506 // Metro mode, add the 'Relaunch Chrome in desktop mode'. |
| 508 AddSeparator(ui::SPACING_SEPARATOR); | 507 AddSeparator(ui::SPACING_SEPARATOR); |
| 509 AddItemWithStringId(IDC_WIN8_DESKTOP_RESTART, IDS_WIN8_DESKTOP_RESTART); | 508 AddItemWithStringId(IDC_WIN8_DESKTOP_RESTART, IDS_WIN8_DESKTOP_RESTART); |
| 510 AddSeparator(ui::SPACING_SEPARATOR); | 509 AddSeparator(ui::SPACING_SEPARATOR); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 zoom_label_ = l10n_util::GetStringFUTF16( | 706 zoom_label_ = l10n_util::GetStringFUTF16( |
| 708 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 707 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
| 709 } | 708 } |
| 710 | 709 |
| 711 string16 WrenchMenuModel::GetSyncMenuLabel() const { | 710 string16 WrenchMenuModel::GetSyncMenuLabel() const { |
| 712 Profile* profile = browser_->profile()->GetOriginalProfile(); | 711 Profile* profile = browser_->profile()->GetOriginalProfile(); |
| 713 return sync_ui_util::GetSyncMenuLabel( | 712 return sync_ui_util::GetSyncMenuLabel( |
| 714 ProfileSyncServiceFactory::GetForProfile(profile), | 713 ProfileSyncServiceFactory::GetForProfile(profile), |
| 715 *SigninManagerFactory::GetForProfile(profile)); | 714 *SigninManagerFactory::GetForProfile(profile)); |
| 716 } | 715 } |
| OLD | NEW |