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

Side by Side Diff: chrome/browser/process_singleton_win.cc

Issue 909183002: win/aura: Remove some more non-aura code for Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 10 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
« no previous file with comments | « chrome/browser/platform_util_win.cc ('k') | chrome/browser/ui/pdf/pdf_unsupported_feature.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/process_singleton.h" 5 #include "chrome/browser/process_singleton.h"
6 6
7 #include <shellapi.h> 7 #include <shellapi.h>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // 1. Windows 8 or greater. 179 // 1. Windows 8 or greater.
180 // 2. Not in Windows 8 immersive mode. 180 // 2. Not in Windows 8 immersive mode.
181 // 3. Chrome is default browser. 181 // 3. Chrome is default browser.
182 // 4. Process integrity level is not high. 182 // 4. Process integrity level is not high.
183 // 5. The profile data directory is the default directory. 183 // 5. The profile data directory is the default directory.
184 // 6. Last used mode was immersive/machine is a tablet. 184 // 6. Last used mode was immersive/machine is a tablet.
185 // TODO(ananta) 185 // TODO(ananta)
186 // Move this function to a common place as the Windows 8 delegate_execute 186 // Move this function to a common place as the Windows 8 delegate_execute
187 // handler can possibly use this. 187 // handler can possibly use this.
188 bool ShouldLaunchInWindows8ImmersiveMode(const base::FilePath& user_data_dir) { 188 bool ShouldLaunchInWindows8ImmersiveMode(const base::FilePath& user_data_dir) {
189 #if defined(USE_AURA)
190 // Returning false from this function doesn't mean we don't launch immersive 189 // Returning false from this function doesn't mean we don't launch immersive
191 // mode in Aura. This function is specifically called in case when we need 190 // mode in Aura. This function is specifically called in case when we need
192 // to relaunch desktop launched chrome into immersive mode through 'relaunch' 191 // to relaunch desktop launched chrome into immersive mode through 'relaunch'
193 // menu. In case of Aura, we will use delegate_execute to do the relaunch. 192 // menu. In case of Aura, we will use delegate_execute to do the relaunch.
194 return false; 193 return false;
195 #else
196 if (base::win::GetVersion() < base::win::VERSION_WIN8)
197 return false;
198
199 if (base::win::IsProcessImmersive(base::GetCurrentProcessHandle()))
200 return false;
201
202 if (ShellIntegration::GetDefaultBrowser() != ShellIntegration::IS_DEFAULT)
203 return false;
204
205 base::IntegrityLevel integrity_level = base::INTEGRITY_UNKNOWN;
206 base::GetProcessIntegrityLevel(base::GetCurrentProcessHandle(),
207 &integrity_level);
208 if (integrity_level == base::HIGH_INTEGRITY)
209 return false;
210
211 base::FilePath default_user_data_dir;
212 if (!chrome::GetDefaultUserDataDirectory(&default_user_data_dir))
213 return false;
214
215 if (default_user_data_dir != user_data_dir)
216 return false;
217
218 base::win::RegKey reg_key;
219 DWORD reg_value = 0;
220 if (reg_key.Create(HKEY_CURRENT_USER, chrome::kMetroRegistryPath,
221 KEY_READ) == ERROR_SUCCESS &&
222 reg_key.ReadValueDW(chrome::kLaunchModeValue,
223 &reg_value) == ERROR_SUCCESS) {
224 return reg_value == 1;
225 }
226 return false;
227 #endif
228 } 194 }
229 195
230 } // namespace 196 } // namespace
231 197
232 // Microsoft's Softricity virtualization breaks the sandbox processes. 198 // Microsoft's Softricity virtualization breaks the sandbox processes.
233 // So, if we detect the Softricity DLL we use WMI Win32_Process.Create to 199 // So, if we detect the Softricity DLL we use WMI Win32_Process.Create to
234 // break out of the virtualization environment. 200 // break out of the virtualization environment.
235 // http://code.google.com/p/chromium/issues/detail?id=43650 201 // http://code.google.com/p/chromium/issues/detail?id=43650
236 bool ProcessSingleton::EscapeVirtualization( 202 bool ProcessSingleton::EscapeVirtualization(
237 const base::FilePath& user_data_dir) { 203 const base::FilePath& user_data_dir) {
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 ::SetEvent(metro_activation_event.Get()); 420 ::SetEvent(metro_activation_event.Get());
455 } 421 }
456 } 422 }
457 } 423 }
458 424
459 return window_.hwnd() != NULL; 425 return window_.hwnd() != NULL;
460 } 426 }
461 427
462 void ProcessSingleton::Cleanup() { 428 void ProcessSingleton::Cleanup() {
463 } 429 }
OLDNEW
« no previous file with comments | « chrome/browser/platform_util_win.cc ('k') | chrome/browser/ui/pdf/pdf_unsupported_feature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698