| 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/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/cpu.h" | 8 #include "base/cpu.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 user_data_dir = base::FilePath::FromUTF8Unsafe(user_data_dir_string); | 343 user_data_dir = base::FilePath::FromUTF8Unsafe(user_data_dir_string); |
| 344 } | 344 } |
| 345 } | 345 } |
| 346 #endif | 346 #endif |
| 347 #if defined(OS_MACOSX) || defined(OS_WIN) | 347 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 348 policy::path_parser::CheckUserDataDirPolicy(&user_data_dir); | 348 policy::path_parser::CheckUserDataDirPolicy(&user_data_dir); |
| 349 #endif | 349 #endif |
| 350 | 350 |
| 351 const bool specified_directory_was_invalid = !user_data_dir.empty() && | 351 const bool specified_directory_was_invalid = !user_data_dir.empty() && |
| 352 !PathService::OverrideAndCreateIfNeeded(chrome::DIR_USER_DATA, | 352 !PathService::OverrideAndCreateIfNeeded(chrome::DIR_USER_DATA, |
| 353 user_data_dir, false, true); | 353 user_data_dir, true); |
| 354 // Save inaccessible or invalid paths so the user may be prompted later. | 354 // Save inaccessible or invalid paths so the user may be prompted later. |
| 355 if (specified_directory_was_invalid) | 355 if (specified_directory_was_invalid) |
| 356 chrome::SetInvalidSpecifiedUserDataDir(user_data_dir); | 356 chrome::SetInvalidSpecifiedUserDataDir(user_data_dir); |
| 357 | 357 |
| 358 // Warn and fail early if the process fails to get a user data directory. | 358 // Warn and fail early if the process fails to get a user data directory. |
| 359 if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { | 359 if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { |
| 360 // If an invalid command-line or policy override was specified, the user | 360 // If an invalid command-line or policy override was specified, the user |
| 361 // will be given an error with that value. Otherwise, use the directory | 361 // will be given an error with that value. Otherwise, use the directory |
| 362 // returned by PathService (or the fallback default directory) in the error. | 362 // returned by PathService (or the fallback default directory) in the error. |
| 363 if (!specified_directory_was_invalid) { | 363 if (!specified_directory_was_invalid) { |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 } | 910 } |
| 911 | 911 |
| 912 content::ContentUtilityClient* | 912 content::ContentUtilityClient* |
| 913 ChromeMainDelegate::CreateContentUtilityClient() { | 913 ChromeMainDelegate::CreateContentUtilityClient() { |
| 914 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 914 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
| 915 return NULL; | 915 return NULL; |
| 916 #else | 916 #else |
| 917 return g_chrome_content_utility_client.Pointer(); | 917 return g_chrome_content_utility_client.Pointer(); |
| 918 #endif | 918 #endif |
| 919 } | 919 } |
| OLD | NEW |