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

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: rebased 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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 551
552 if (!browser_->profile()->IsOffTheRecord()) { 552 if (!browser_->profile()->IsOffTheRecord()) {
553 recent_tabs_sub_menu_model_.reset(new RecentTabsSubMenuModel(provider_, 553 recent_tabs_sub_menu_model_.reset(new RecentTabsSubMenuModel(provider_,
554 browser_, 554 browser_,
555 NULL)); 555 NULL));
556 AddSubMenuWithStringId(IDC_RECENT_TABS_MENU, IDS_RECENT_TABS_MENU, 556 AddSubMenuWithStringId(IDC_RECENT_TABS_MENU, IDS_RECENT_TABS_MENU,
557 recent_tabs_sub_menu_model_.get()); 557 recent_tabs_sub_menu_model_.get());
558 } 558 }
559 559
560 #if defined(OS_WIN) 560 #if defined(OS_WIN)
561 if (base::win::GetVersion() >= base::win::VERSION_WIN7 && 561 // Windows 8 can support ASH mode using WARP, but Windows 7 requires a working
562 content::GpuDataManager::GetInstance()->CanUseGpuBrowserCompositor()) { 562 // GPU compositor.
563 if ((base::win::GetVersion() >= base::win::VERSION_WIN7 &&
564 content::GpuDataManager::GetInstance()->CanUseGpuBrowserCompositor()) ||
565 (base::win::GetVersion() >= base::win::VERSION_WIN8)) {
563 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) { 566 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) {
564 // ASH/Metro mode, add the 'Relaunch Chrome in desktop mode'. 567 // ASH/Metro mode, add the 'Relaunch Chrome in desktop mode'.
565 AddSeparator(ui::NORMAL_SEPARATOR); 568 AddSeparator(ui::NORMAL_SEPARATOR);
566 AddItemWithStringId(IDC_WIN_DESKTOP_RESTART, IDS_WIN_DESKTOP_RESTART); 569 AddItemWithStringId(IDC_WIN_DESKTOP_RESTART, IDS_WIN_DESKTOP_RESTART);
567 } else { 570 } else {
568 // In Windows 8 desktop, add the 'Relaunch Chrome in Windows 8 mode'. 571 // In Windows 8 desktop, add the 'Relaunch Chrome in Windows 8 mode'.
569 // In Windows 7 desktop, add the 'Relaunch Chrome in Windows ASH mode' 572 // In Windows 7 desktop, add the 'Relaunch Chrome in Windows ASH mode'
570 AddSeparator(ui::NORMAL_SEPARATOR); 573 AddSeparator(ui::NORMAL_SEPARATOR);
571 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { 574 if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
572 AddItemWithStringId(IDC_WIN8_METRO_RESTART, IDS_WIN8_METRO_RESTART); 575 AddItemWithStringId(IDC_WIN8_METRO_RESTART, IDS_WIN8_METRO_RESTART);
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 ->GetZoomPercent(); 780 ->GetZoomPercent();
778 } 781 }
779 zoom_label_ = l10n_util::GetStringFUTF16( 782 zoom_label_ = l10n_util::GetStringFUTF16(
780 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); 783 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent));
781 } 784 }
782 785
783 void WrenchMenuModel::OnZoomLevelChanged( 786 void WrenchMenuModel::OnZoomLevelChanged(
784 const content::HostZoomMap::ZoomLevelChange& change) { 787 const content::HostZoomMap::ZoomLevelChange& change) {
785 UpdateZoomControls(); 788 UpdateZoomControls();
786 } 789 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698