| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "app/win/scoped_co_mem.h" | 13 #include "app/win/scoped_co_mem.h" |
| 14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
| 15 #include "base/path_service.h" | 15 #include "base/path_service.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 "chrome/installer/util/master_preferences.h" | |
| 19 | 18 |
| 20 namespace chrome { | 19 namespace chrome { |
| 21 | 20 |
| 22 bool GetDefaultUserDataDirectory(FilePath* result) { | 21 bool GetDefaultUserDataDirectory(FilePath* result) { |
| 23 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result)) | 22 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result)) |
| 24 return false; | 23 return false; |
| 25 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 24 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 26 *result = result->Append(dist->GetInstallSubDir()); | 25 *result = result->Append(dist->GetInstallSubDir()); |
| 27 *result = result->Append(chrome::kUserDataDirname); | 26 *result = result->Append(chrome::kUserDataDirname); |
| 28 return true; | 27 return true; |
| 29 } | 28 } |
| 30 | 29 |
| 31 bool GetChromeFrameUserDataDirectory(FilePath* result) { | 30 bool GetChromeFrameUserDataDirectory(FilePath* result) { |
| 32 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result)) | 31 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result)) |
| 33 return false; | 32 return false; |
| 34 BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( | 33 BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( |
| 35 BrowserDistribution::CHROME_FRAME, | 34 BrowserDistribution::CHROME_FRAME); |
| 36 installer::MasterPreferences::ForCurrentProcess()); | |
| 37 *result = result->Append(dist->GetInstallSubDir()); | 35 *result = result->Append(dist->GetInstallSubDir()); |
| 38 *result = result->Append(chrome::kUserDataDirname); | 36 *result = result->Append(chrome::kUserDataDirname); |
| 39 return true; | 37 return true; |
| 40 } | 38 } |
| 41 | 39 |
| 42 void GetUserCacheDirectory(const FilePath& profile_dir, FilePath* result) { | 40 void GetUserCacheDirectory(const FilePath& profile_dir, FilePath* result) { |
| 43 // This function does more complicated things on Mac/Linux. | 41 // This function does more complicated things on Mac/Linux. |
| 44 *result = profile_dir; | 42 *result = profile_dir; |
| 45 } | 43 } |
| 46 | 44 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 wchar_t system_buffer[MAX_PATH]; | 88 wchar_t system_buffer[MAX_PATH]; |
| 91 system_buffer[0] = 0; | 89 system_buffer[0] = 0; |
| 92 if (FAILED(SHGetFolderPath(NULL, CSIDL_DESKTOPDIRECTORY, NULL, | 90 if (FAILED(SHGetFolderPath(NULL, CSIDL_DESKTOPDIRECTORY, NULL, |
| 93 SHGFP_TYPE_CURRENT, system_buffer))) | 91 SHGFP_TYPE_CURRENT, system_buffer))) |
| 94 return false; | 92 return false; |
| 95 *result = FilePath(system_buffer); | 93 *result = FilePath(system_buffer); |
| 96 return true; | 94 return true; |
| 97 } | 95 } |
| 98 | 96 |
| 99 } // namespace chrome | 97 } // namespace chrome |
| OLD | NEW |