Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(611)

Side by Side Diff: chrome/browser/ui/toolbar/wrench_menu_model.cc

Issue 11411286: Decouple IsMetroProcess() calls, introducing IsSingleWindowMetroMode(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge up to r170746 Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 Metro, we only show the New Window options if there isn't already
cpu_(ooo_6.6-7.5) 2012/12/03 20:56:26 reword
gab 2012/12/04 00:19:06 Done.
479 // a window of the requested type (incognito or not) that is available. 480 // a window of the requested type (incognito or not) that is available.
480 if (browser_->profile()->IsOffTheRecord()) { 481 if (browser_->profile()->IsOffTheRecord()) {
481 if (browser::FindBrowserWithProfile( 482 if (browser::FindBrowserWithProfile(
482 browser_->profile()->GetOriginalProfile(), 483 browser_->profile()->GetOriginalProfile(),
483 browser_->host_desktop_type()) == NULL) { 484 browser_->host_desktop_type()) == NULL) {
484 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); 485 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW);
485 } 486 }
486 } else if (!browser_->profile()->HasOffTheRecordProfile()) { 487 } else if (!browser_->profile()->HasOffTheRecordProfile()) {
487 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); 488 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW);
488 } 489 }
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 zoom_label_ = l10n_util::GetStringFUTF16( 723 zoom_label_ = l10n_util::GetStringFUTF16(
723 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); 724 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent));
724 } 725 }
725 726
726 string16 WrenchMenuModel::GetSyncMenuLabel() const { 727 string16 WrenchMenuModel::GetSyncMenuLabel() const {
727 Profile* profile = browser_->profile()->GetOriginalProfile(); 728 Profile* profile = browser_->profile()->GetOriginalProfile();
728 return sync_ui_util::GetSyncMenuLabel( 729 return sync_ui_util::GetSyncMenuLabel(
729 ProfileSyncServiceFactory::GetForProfile(profile), 730 ProfileSyncServiceFactory::GetForProfile(profile),
730 *SigninManagerFactory::GetForProfile(profile)); 731 *SigninManagerFactory::GetForProfile(profile));
731 } 732 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698