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

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

Issue 435383002: adds WARP support to Chromium, for Metro mode only, on Windows 8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't check command line if it isn't there Created 6 years, 3 months 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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 559
560 if (!browser_->profile()->IsOffTheRecord()) { 560 if (!browser_->profile()->IsOffTheRecord()) {
561 recent_tabs_sub_menu_model_.reset(new RecentTabsSubMenuModel(provider_, 561 recent_tabs_sub_menu_model_.reset(new RecentTabsSubMenuModel(provider_,
562 browser_, 562 browser_,
563 NULL)); 563 NULL));
564 AddSubMenuWithStringId(IDC_RECENT_TABS_MENU, IDS_RECENT_TABS_MENU, 564 AddSubMenuWithStringId(IDC_RECENT_TABS_MENU, IDS_RECENT_TABS_MENU,
565 recent_tabs_sub_menu_model_.get()); 565 recent_tabs_sub_menu_model_.get());
566 } 566 }
567 567
568 #if defined(OS_WIN) 568 #if defined(OS_WIN)
569 569 if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
570 #if defined(USE_AURA)
571 if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
572 content::GpuDataManager::GetInstance()->CanUseGpuBrowserCompositor()) {
573 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) { 570 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) {
574 // Metro mode, add the 'Relaunch Chrome in desktop mode'. 571 // Metro mode, add the 'Relaunch Chrome in desktop mode'.
575 AddSeparator(ui::NORMAL_SEPARATOR); 572 AddSeparator(ui::NORMAL_SEPARATOR);
576 AddItemWithStringId(IDC_WIN8_DESKTOP_RESTART, IDS_WIN8_DESKTOP_RESTART); 573 AddItemWithStringId(IDC_WIN8_DESKTOP_RESTART, IDS_WIN8_DESKTOP_RESTART);
577 } else { 574 } else {
578 // In Windows 8 desktop, add the 'Relaunch Chrome in Windows 8 mode'. 575 // In Windows 8 desktop, add the 'Relaunch Chrome in Windows 8 mode'.
579 AddSeparator(ui::NORMAL_SEPARATOR); 576 AddSeparator(ui::NORMAL_SEPARATOR);
580 AddItemWithStringId(IDC_WIN8_METRO_RESTART, IDS_WIN8_METRO_RESTART); 577 AddItemWithStringId(IDC_WIN8_METRO_RESTART, IDS_WIN8_METRO_RESTART);
581 } 578 }
582 } 579 }
583 #else
584 if (base::win::IsMetroProcess()) {
585 // Metro mode, add the 'Relaunch Chrome in desktop mode'.
586 AddSeparator(ui::NORMAL_SEPARATOR);
587 AddItemWithStringId(IDC_WIN8_DESKTOP_RESTART, IDS_WIN8_DESKTOP_RESTART);
588 } else {
589 // In Windows 8 desktop, add the 'Relaunch Chrome in Windows 8 mode'.
590 AddSeparator(ui::NORMAL_SEPARATOR);
591 AddItemWithStringId(IDC_WIN8_METRO_RESTART, IDS_WIN8_METRO_RESTART);
592 }
593 #endif
594
595 #endif 580 #endif
596 581
597 // Append the full menu including separators. The final separator only gets 582 // Append the full menu including separators. The final separator only gets
598 // appended when this is a touch menu - otherwise it would get added twice. 583 // appended when this is a touch menu - otherwise it would get added twice.
599 CreateCutCopyPasteMenu(); 584 CreateCutCopyPasteMenu();
600 585
601 if (CommandLine::ForCurrentProcess()->HasSwitch( 586 if (CommandLine::ForCurrentProcess()->HasSwitch(
602 switches::kEnableDomDistiller)) { 587 switches::kEnableDomDistiller)) {
603 AddItemWithStringId(IDC_DISTILL_PAGE, IDS_DISTILL_PAGE); 588 AddItemWithStringId(IDC_DISTILL_PAGE, IDS_DISTILL_PAGE);
604 } 589 }
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 ->GetZoomPercent(); 779 ->GetZoomPercent();
795 } 780 }
796 zoom_label_ = l10n_util::GetStringFUTF16( 781 zoom_label_ = l10n_util::GetStringFUTF16(
797 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); 782 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent));
798 } 783 }
799 784
800 void WrenchMenuModel::OnZoomLevelChanged( 785 void WrenchMenuModel::OnZoomLevelChanged(
801 const content::HostZoomMap::ZoomLevelChange& change) { 786 const content::HostZoomMap::ZoomLevelChange& change) {
802 UpdateZoomControls(); 787 UpdateZoomControls();
803 } 788 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698