| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/common/chrome_paths_internal.h" | 5 #include "chrome/common/chrome_paths_internal.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <knownfolders.h> | 8 #include <knownfolders.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #include <shlobj.h> | 10 #include <shlobj.h> |
| 11 #include <shobjidl.h> | 11 #include <shobjidl.h> |
| 12 | 12 |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/win/scoped_co_mem.h" | 15 #include "base/win/scoped_co_mem.h" |
| 16 #include "chrome/common/chrome_constants.h" | 16 #include "chrome/common/chrome_constants.h" |
| 17 #include "chrome/installer/util/browser_distribution.h" | 17 #include "chrome/installer/util/browser_distribution.h" |
| 18 #include "content/public/common/content_switches.h" |
| 18 | 19 |
| 19 namespace chrome { | 20 namespace chrome { |
| 20 | 21 |
| 21 bool GetDefaultUserDataDirectory(FilePath* result) { | 22 bool GetDefaultUserDataDirectory(FilePath* result) { |
| 22 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result)) | 23 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result)) |
| 23 return false; | 24 return false; |
| 24 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 25 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 25 *result = result->Append(dist->GetInstallSubDir()); | 26 *result = result->Append(dist->GetInstallSubDir()); |
| 26 *result = result->Append(chrome::kUserDataDirname); | 27 *result = result->Append(chrome::kUserDataDirname); |
| 27 return true; | 28 return true; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // so we don't bother handling it. | 88 // so we don't bother handling it. |
| 88 wchar_t system_buffer[MAX_PATH]; | 89 wchar_t system_buffer[MAX_PATH]; |
| 89 system_buffer[0] = 0; | 90 system_buffer[0] = 0; |
| 90 if (FAILED(SHGetFolderPath(NULL, CSIDL_DESKTOPDIRECTORY, NULL, | 91 if (FAILED(SHGetFolderPath(NULL, CSIDL_DESKTOPDIRECTORY, NULL, |
| 91 SHGFP_TYPE_CURRENT, system_buffer))) | 92 SHGFP_TYPE_CURRENT, system_buffer))) |
| 92 return false; | 93 return false; |
| 93 *result = FilePath(system_buffer); | 94 *result = FilePath(system_buffer); |
| 94 return true; | 95 return true; |
| 95 } | 96 } |
| 96 | 97 |
| 98 bool ProcessNeedsProfileDir(const std::string& process_type) { |
| 99 // On windows we don't want subprocesses other than the browser process and |
| 100 // service processes to be able to use the profile directory because if it |
| 101 // lies on a network share the sandbox will prevent us from accessing it. |
| 102 return process_type.empty() || process_type == switches::kServiceProcess; |
| 103 } |
| 104 |
| 97 } // namespace chrome | 105 } // namespace chrome |
| OLD | NEW |