| 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/prefs/chrome_command_line_pref_store.h> | 5 #include <chrome/browser/prefs/chrome_command_line_pref_store.h> |
| 6 #include "chrome/browser/prefs/chrome_pref_service_factory.h" | 6 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 int message_id = 0; | 312 int message_id = 0; |
| 313 if (error <= PersistentPrefStore::PREF_READ_ERROR_JSON_TYPE) { | 313 if (error <= PersistentPrefStore::PREF_READ_ERROR_JSON_TYPE) { |
| 314 message_id = IDS_PREFERENCES_CORRUPT_ERROR; | 314 message_id = IDS_PREFERENCES_CORRUPT_ERROR; |
| 315 } else if (error != PersistentPrefStore::PREF_READ_ERROR_NO_FILE) { | 315 } else if (error != PersistentPrefStore::PREF_READ_ERROR_NO_FILE) { |
| 316 message_id = IDS_PREFERENCES_UNREADABLE_ERROR; | 316 message_id = IDS_PREFERENCES_UNREADABLE_ERROR; |
| 317 } | 317 } |
| 318 | 318 |
| 319 if (message_id) { | 319 if (message_id) { |
| 320 BrowserThread::PostTask( | 320 BrowserThread::PostTask( |
| 321 BrowserThread::UI, FROM_HERE, | 321 BrowserThread::UI, FROM_HERE, |
| 322 base::Bind(&ShowProfileErrorDialog, ProfileErrorType::PREFERENCES, | 322 base::BindOnce(&ShowProfileErrorDialog, ProfileErrorType::PREFERENCES, |
| 323 message_id, | 323 message_id, |
| 324 sql::GetCorruptFileDiagnosticsInfo(pref_filename))); | 324 sql::GetCorruptFileDiagnosticsInfo(pref_filename))); |
| 325 } | 325 } |
| 326 #else | 326 #else |
| 327 // On ChromeOS error screen with message about broken local state | 327 // On ChromeOS error screen with message about broken local state |
| 328 // will be displayed. | 328 // will be displayed. |
| 329 | 329 |
| 330 // A supplementary error message about broken local state - is included | 330 // A supplementary error message about broken local state - is included |
| 331 // in logs and user feedbacks. | 331 // in logs and user feedbacks. |
| 332 if (error != PersistentPrefStore::PREF_READ_ERROR_NONE && | 332 if (error != PersistentPrefStore::PREF_READ_ERROR_NONE && |
| 333 error != PersistentPrefStore::PREF_READ_ERROR_NO_FILE) { | 333 error != PersistentPrefStore::PREF_READ_ERROR_NO_FILE) { |
| 334 LOG(ERROR) << "An error happened during prefs loading: " << error; | 334 LOG(ERROR) << "An error happened during prefs loading: " << error; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 | 502 |
| 503 void ClearResetTime(Profile* profile) { | 503 void ClearResetTime(Profile* profile) { |
| 504 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs()); | 504 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs()); |
| 505 } | 505 } |
| 506 | 506 |
| 507 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 507 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 508 ProfilePrefStoreManager::RegisterProfilePrefs(registry); | 508 ProfilePrefStoreManager::RegisterProfilePrefs(registry); |
| 509 } | 509 } |
| 510 | 510 |
| 511 } // namespace chrome_prefs | 511 } // namespace chrome_prefs |
| OLD | NEW |