| OLD | NEW |
| 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/common/chrome_paths_internal.h" | 5 #include "chrome/common/chrome_paths_internal.h" |
| 6 | 6 |
| 7 #include "base/environment.h" | 7 #include "base/environment.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/nix/xdg_util.h" | 10 #include "base/nix/xdg_util.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 base::FilePath config_dir(GetXDGDirectory(env.get(), | 90 base::FilePath config_dir(GetXDGDirectory(env.get(), |
| 91 kXdgConfigHomeEnvVar, | 91 kXdgConfigHomeEnvVar, |
| 92 kDotConfigDir)); | 92 kDotConfigDir)); |
| 93 | 93 |
| 94 if (!config_dir.AppendRelativePath(profile_dir, &cache_dir)) | 94 if (!config_dir.AppendRelativePath(profile_dir, &cache_dir)) |
| 95 return; | 95 return; |
| 96 | 96 |
| 97 *result = cache_dir; | 97 *result = cache_dir; |
| 98 } | 98 } |
| 99 | 99 |
| 100 bool GetChromeFrameUserDataDirectory(base::FilePath* result) { | |
| 101 scoped_ptr<base::Environment> env(base::Environment::Create()); | |
| 102 base::FilePath config_dir(GetXDGDirectory(env.get(), | |
| 103 kXdgConfigHomeEnvVar, | |
| 104 kDotConfigDir)); | |
| 105 #if defined(GOOGLE_CHROME_BUILD) | |
| 106 *result = config_dir.Append("google-chrome-frame"); | |
| 107 #else | |
| 108 *result = config_dir.Append("chrome-frame"); | |
| 109 #endif | |
| 110 return true; | |
| 111 } | |
| 112 | |
| 113 bool GetUserDocumentsDirectory(base::FilePath* result) { | 100 bool GetUserDocumentsDirectory(base::FilePath* result) { |
| 114 *result = GetXDGUserDirectory("DOCUMENTS", "Documents"); | 101 *result = GetXDGUserDirectory("DOCUMENTS", "Documents"); |
| 115 return true; | 102 return true; |
| 116 } | 103 } |
| 117 | 104 |
| 118 bool GetUserDownloadsDirectorySafe(base::FilePath* result) { | 105 bool GetUserDownloadsDirectorySafe(base::FilePath* result) { |
| 119 base::FilePath home = base::GetHomeDir(); | 106 base::FilePath home = base::GetHomeDir(); |
| 120 *result = home.Append(kDownloadsDir); | 107 *result = home.Append(kDownloadsDir); |
| 121 return true; | 108 return true; |
| 122 } | 109 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 145 } | 132 } |
| 146 | 133 |
| 147 bool ProcessNeedsProfileDir(const std::string& process_type) { | 134 bool ProcessNeedsProfileDir(const std::string& process_type) { |
| 148 // For now we have no reason to forbid this on Linux as we don't | 135 // For now we have no reason to forbid this on Linux as we don't |
| 149 // have the roaming profile troubles there. Moreover the Linux breakpad needs | 136 // have the roaming profile troubles there. Moreover the Linux breakpad needs |
| 150 // profile dir access in all process if enabled on Linux. | 137 // profile dir access in all process if enabled on Linux. |
| 151 return true; | 138 return true; |
| 152 } | 139 } |
| 153 | 140 |
| 154 } // namespace chrome | 141 } // namespace chrome |
| OLD | NEW |