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/browser/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 return base.Append(chrome::kMediaCacheDirname); | 210 return base.Append(chrome::kMediaCacheDirname); |
211 } | 211 } |
212 | 212 |
213 void EnsureReadmeFile(const base::FilePath& base) { | 213 void EnsureReadmeFile(const base::FilePath& base) { |
214 base::FilePath readme_path = base.Append(chrome::kReadmeFilename); | 214 base::FilePath readme_path = base.Append(chrome::kReadmeFilename); |
215 if (base::PathExists(readme_path)) | 215 if (base::PathExists(readme_path)) |
216 return; | 216 return; |
217 std::string product_name = l10n_util::GetStringUTF8(IDS_PRODUCT_NAME); | 217 std::string product_name = l10n_util::GetStringUTF8(IDS_PRODUCT_NAME); |
218 std::string readme_text = base::StringPrintf( | 218 std::string readme_text = base::StringPrintf( |
219 kReadmeText, product_name.c_str(), product_name.c_str()); | 219 kReadmeText, product_name.c_str(), product_name.c_str()); |
220 if (file_util::WriteFile( | 220 if (base::WriteFile(readme_path, readme_text.data(), readme_text.size()) == |
221 readme_path, readme_text.data(), readme_text.size()) == -1) { | 221 -1) { |
222 LOG(ERROR) << "Could not create README file."; | 222 LOG(ERROR) << "Could not create README file."; |
223 } | 223 } |
224 } | 224 } |
225 | 225 |
226 // Converts the kSessionExitedCleanly pref to the corresponding EXIT_TYPE. | 226 // Converts the kSessionExitedCleanly pref to the corresponding EXIT_TYPE. |
227 Profile::ExitType SessionTypePrefValueToExitType(const std::string& value) { | 227 Profile::ExitType SessionTypePrefValueToExitType(const std::string& value) { |
228 if (value == kPrefExitTypeSessionEnded) | 228 if (value == kPrefExitTypeSessionEnded) |
229 return Profile::EXIT_SESSION_ENDED; | 229 return Profile::EXIT_SESSION_ENDED; |
230 if (value == kPrefExitTypeCrashed) | 230 if (value == kPrefExitTypeCrashed) |
231 return Profile::EXIT_CRASHED; | 231 return Profile::EXIT_CRASHED; |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { | 1269 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { |
1270 #if defined(OS_CHROMEOS) | 1270 #if defined(OS_CHROMEOS) |
1271 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 1271 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
1272 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 1272 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
1273 g_browser_process->local_state()); | 1273 g_browser_process->local_state()); |
1274 } | 1274 } |
1275 #endif // defined(OS_CHROMEOS) | 1275 #endif // defined(OS_CHROMEOS) |
1276 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 1276 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
1277 GetPrefs(), g_browser_process->local_state()); | 1277 GetPrefs(), g_browser_process->local_state()); |
1278 } | 1278 } |
OLD | NEW |