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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 #if defined(TOOLKIT_GTK) | 64 #if defined(TOOLKIT_GTK) |
65 #include <gtk/gtk.h> | 65 #include <gtk/gtk.h> |
66 #include "chrome/browser/ui/gtk/gtk_util.h" | 66 #include "chrome/browser/ui/gtk/gtk_util.h" |
67 #endif | 67 #endif |
68 | 68 |
69 #if defined(OS_WIN) | 69 #if defined(OS_WIN) |
70 #include "base/win/metro.h" | 70 #include "base/win/metro.h" |
71 #include "base/win/windows_version.h" | 71 #include "base/win/windows_version.h" |
72 #include "chrome/browser/enumerate_modules_model_win.h" | 72 #include "chrome/browser/enumerate_modules_model_win.h" |
73 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" | 73 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" |
| 74 #include "win8/util/win8_util.h" |
74 #endif | 75 #endif |
75 | 76 |
76 #if defined(USE_ASH) | 77 #if defined(USE_ASH) |
77 #include "ash/shell.h" | 78 #include "ash/shell.h" |
78 #endif | 79 #endif |
79 | 80 |
80 using content::HostZoomMap; | 81 using content::HostZoomMap; |
81 using content::UserMetricsAction; | 82 using content::UserMetricsAction; |
82 using content::WebContents; | 83 using content::WebContents; |
83 | 84 |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 } | 468 } |
468 | 469 |
469 void WrenchMenuModel::Build(bool is_new_menu, bool supports_new_separators) { | 470 void WrenchMenuModel::Build(bool is_new_menu, bool supports_new_separators) { |
470 #if defined(USE_AURA) | 471 #if defined(USE_AURA) |
471 if (is_new_menu) | 472 if (is_new_menu) |
472 AddSeparator(ui::SPACING_SEPARATOR); | 473 AddSeparator(ui::SPACING_SEPARATOR); |
473 #endif | 474 #endif |
474 | 475 |
475 AddItemWithStringId(IDC_NEW_TAB, IDS_NEW_TAB); | 476 AddItemWithStringId(IDC_NEW_TAB, IDS_NEW_TAB); |
476 #if defined(OS_WIN) | 477 #if defined(OS_WIN) |
477 if (base::win::IsMetroProcess()) { | 478 if (win8::IsSingleWindowMetroMode()) { |
478 // In Metro, we only show the New Window options if there isn't already | 479 // In Win8's single window Metro mode, we only show the New Window options |
479 // a window of the requested type (incognito or not) that is available. | 480 // if there isn't already a window of the requested type (incognito or not) |
| 481 // that is available. |
480 if (browser_->profile()->IsOffTheRecord()) { | 482 if (browser_->profile()->IsOffTheRecord()) { |
481 if (browser::FindBrowserWithProfile( | 483 if (browser::FindBrowserWithProfile( |
482 browser_->profile()->GetOriginalProfile(), | 484 browser_->profile()->GetOriginalProfile(), |
483 browser_->host_desktop_type()) == NULL) { | 485 browser_->host_desktop_type()) == NULL) { |
484 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); | 486 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); |
485 } | 487 } |
486 } else if (!browser_->profile()->HasOffTheRecordProfile()) { | 488 } else if (!browser_->profile()->HasOffTheRecordProfile()) { |
487 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); | 489 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); |
488 } | 490 } |
489 } else { | 491 } else { |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 zoom_label_ = l10n_util::GetStringFUTF16( | 724 zoom_label_ = l10n_util::GetStringFUTF16( |
723 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 725 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
724 } | 726 } |
725 | 727 |
726 string16 WrenchMenuModel::GetSyncMenuLabel() const { | 728 string16 WrenchMenuModel::GetSyncMenuLabel() const { |
727 Profile* profile = browser_->profile()->GetOriginalProfile(); | 729 Profile* profile = browser_->profile()->GetOriginalProfile(); |
728 return sync_ui_util::GetSyncMenuLabel( | 730 return sync_ui_util::GetSyncMenuLabel( |
729 ProfileSyncServiceFactory::GetForProfile(profile), | 731 ProfileSyncServiceFactory::GetForProfile(profile), |
730 *SigninManagerFactory::GetForProfile(profile)); | 732 *SigninManagerFactory::GetForProfile(profile)); |
731 } | 733 } |
OLD | NEW |