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

Side by Side Diff: chrome/browser/lifetime/application_lifetime_win.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: first round of tryfixes Created 6 years, 4 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/lifetime/application_lifetime.h" 5 #include "chrome/browser/lifetime/application_lifetime.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/win/metro.h" 9 #include "base/win/metro.h"
10 #include "base/win/windows_version.h" 10 #include "base/win/windows_version.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/first_run/upgrade_util.h" 12 #include "chrome/browser/first_run/upgrade_util.h"
13 #include "chrome/browser/ui/browser_finder.h" 13 #include "chrome/browser/ui/browser_finder.h"
14 #include "chrome/common/pref_names.h" 14 #include "chrome/common/pref_names.h"
15 #include "content/public/browser/gpu_data_manager.h"
15 #include "ui/views/widget/widget.h" 16 #include "ui/views/widget/widget.h"
16 17
17 #if defined(USE_AURA) 18 #if defined(USE_AURA)
18 #include "base/environment.h" 19 #include "base/environment.h"
19 #include "base/files/file_path.h" 20 #include "base/files/file_path.h"
20 #include "base/path_service.h" 21 #include "base/path_service.h"
21 #include "chrome/browser/metro_utils/metro_chrome_win.h" 22 #include "chrome/browser/metro_utils/metro_chrome_win.h"
22 #include "chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.h " 23 #include "chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.h "
23 #include "chrome/browser/shell_integration.h" 24 #include "chrome/browser/shell_integration.h"
24 #include "chrome/common/chrome_constants.h" 25 #include "chrome/common/chrome_constants.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // to send an IPC to the viewer to do the ShellExecute. 91 // to send an IPC to the viewer to do the ShellExecute.
91 ChromeMetroViewerProcessHost::HandleActivateDesktop( 92 ChromeMetroViewerProcessHost::HandleActivateDesktop(
92 path, ash_execution_status == ASH_TERMINATE); 93 path, ash_execution_status == ASH_TERMINATE);
93 } 94 }
94 #endif 95 #endif
95 96
96 void AttemptRestartToDesktopMode() { 97 void AttemptRestartToDesktopMode() {
97 PrefService* prefs = g_browser_process->local_state(); 98 PrefService* prefs = g_browser_process->local_state();
98 prefs->SetString(prefs::kRelaunchMode, 99 prefs->SetString(prefs::kRelaunchMode,
99 upgrade_util::kRelaunchModeDesktop); 100 upgrade_util::kRelaunchModeDesktop);
100 101 content::GpuDataManager::GetInstance()->SetShouldUseWarp(false);
101 AttemptRestart(); 102 AttemptRestart();
102 } 103 }
103 104
104 void AttemptRestartToMetroMode() { 105 void AttemptRestartToMetroMode() {
105 PrefService* prefs = g_browser_process->local_state(); 106 PrefService* prefs = g_browser_process->local_state();
106 prefs->SetString(prefs::kRelaunchMode, 107 prefs->SetString(prefs::kRelaunchMode,
107 upgrade_util::kRelaunchModeMetro); 108 upgrade_util::kRelaunchModeMetro);
109 // If we cannot use the GPU on this device we enable WARP software rendering
110 // for Metro mode, so we can use Metro mode which requires a Gpu.
111 if (!content::GpuDataManager::GetInstance()->GpuAccessAllowed(NULL)) {
sky 2014/08/20 22:37:03 nit: no {}
luken 2014/08/27 20:43:46 Deprecated code.
112 content::GpuDataManager::GetInstance()->SetShouldUseWarp(true);
113 }
108 AttemptRestart(); 114 AttemptRestart();
109 } 115 }
110 116
111 } // namespace chrome 117 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698