| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 OnPrefsLoaded(true); | 367 OnPrefsLoaded(true); |
| 368 } | 368 } |
| 369 } | 369 } |
| 370 | 370 |
| 371 void ProfileImpl::DoFinalInit() { | 371 void ProfileImpl::DoFinalInit() { |
| 372 PrefService* prefs = GetPrefs(); | 372 PrefService* prefs = GetPrefs(); |
| 373 pref_change_registrar_.Init(prefs); | 373 pref_change_registrar_.Init(prefs); |
| 374 pref_change_registrar_.Add(prefs::kSpellCheckDictionary, this); | 374 pref_change_registrar_.Add(prefs::kSpellCheckDictionary, this); |
| 375 pref_change_registrar_.Add(prefs::kEnableSpellCheck, this); | 375 pref_change_registrar_.Add(prefs::kEnableSpellCheck, this); |
| 376 pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this); | 376 pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this); |
| 377 pref_change_registrar_.Add(prefs::kSpeechInputCensorResults, this); | 377 pref_change_registrar_.Add(prefs::kSpeechInputFilterProfanities, this); |
| 378 pref_change_registrar_.Add(prefs::kClearSiteDataOnExit, this); | 378 pref_change_registrar_.Add(prefs::kClearSiteDataOnExit, this); |
| 379 pref_change_registrar_.Add(prefs::kGoogleServicesUsername, this); | 379 pref_change_registrar_.Add(prefs::kGoogleServicesUsername, this); |
| 380 pref_change_registrar_.Add(prefs::kDefaultZoomLevel, this); | 380 pref_change_registrar_.Add(prefs::kDefaultZoomLevel, this); |
| 381 | 381 |
| 382 // It would be nice to use PathService for fetching this directory, but | 382 // It would be nice to use PathService for fetching this directory, but |
| 383 // the cache directory depends on the profile directory, which isn't available | 383 // the cache directory depends on the profile directory, which isn't available |
| 384 // to PathService. | 384 // to PathService. |
| 385 chrome::GetUserCacheDirectory(path_, &base_cache_path_); | 385 chrome::GetUserCacheDirectory(path_, &base_cache_path_); |
| 386 if (!delegate_) { | 386 if (!delegate_) { |
| 387 if (!file_util::CreateDirectory(base_cache_path_)) | 387 if (!file_util::CreateDirectory(base_cache_path_)) |
| (...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1493 *pref_name_in == prefs::kEnableSpellCheck) { | 1493 *pref_name_in == prefs::kEnableSpellCheck) { |
| 1494 ReinitializeSpellCheckHost(true); | 1494 ReinitializeSpellCheckHost(true); |
| 1495 } else if (*pref_name_in == prefs::kEnableAutoSpellCorrect) { | 1495 } else if (*pref_name_in == prefs::kEnableAutoSpellCorrect) { |
| 1496 bool enabled = prefs->GetBoolean(prefs::kEnableAutoSpellCorrect); | 1496 bool enabled = prefs->GetBoolean(prefs::kEnableAutoSpellCorrect); |
| 1497 for (RenderProcessHost::iterator | 1497 for (RenderProcessHost::iterator |
| 1498 i(RenderProcessHost::AllHostsIterator()); | 1498 i(RenderProcessHost::AllHostsIterator()); |
| 1499 !i.IsAtEnd(); i.Advance()) { | 1499 !i.IsAtEnd(); i.Advance()) { |
| 1500 RenderProcessHost* process = i.GetCurrentValue(); | 1500 RenderProcessHost* process = i.GetCurrentValue(); |
| 1501 process->Send(new SpellCheckMsg_EnableAutoSpellCorrect(enabled)); | 1501 process->Send(new SpellCheckMsg_EnableAutoSpellCorrect(enabled)); |
| 1502 } | 1502 } |
| 1503 } else if (*pref_name_in == prefs::kSpeechInputCensorResults) { | 1503 } else if (*pref_name_in == prefs::kSpeechInputFilterProfanities) { |
| 1504 GetSpeechInputPreferences()->set_censor_results(prefs->GetBoolean( | 1504 GetSpeechInputPreferences()->set_filter_profanities(prefs->GetBoolean( |
| 1505 prefs::kSpeechInputCensorResults)); | 1505 prefs::kSpeechInputFilterProfanities)); |
| 1506 } else if (*pref_name_in == prefs::kClearSiteDataOnExit) { | 1506 } else if (*pref_name_in == prefs::kClearSiteDataOnExit) { |
| 1507 clear_local_state_on_exit_ = | 1507 clear_local_state_on_exit_ = |
| 1508 prefs->GetBoolean(prefs::kClearSiteDataOnExit); | 1508 prefs->GetBoolean(prefs::kClearSiteDataOnExit); |
| 1509 if (webkit_context_) { | 1509 if (webkit_context_) { |
| 1510 webkit_context_->set_clear_local_state_on_exit( | 1510 webkit_context_->set_clear_local_state_on_exit( |
| 1511 clear_local_state_on_exit_); | 1511 clear_local_state_on_exit_); |
| 1512 } | 1512 } |
| 1513 if (db_tracker_) { | 1513 if (db_tracker_) { |
| 1514 db_tracker_->SetClearLocalStateOnExit( | 1514 db_tracker_->SetClearLocalStateOnExit( |
| 1515 clear_local_state_on_exit_); | 1515 clear_local_state_on_exit_); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1759 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { | 1759 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { |
| 1760 if (!spellcheck_profile_.get()) | 1760 if (!spellcheck_profile_.get()) |
| 1761 spellcheck_profile_.reset(new SpellCheckProfile()); | 1761 spellcheck_profile_.reset(new SpellCheckProfile()); |
| 1762 return spellcheck_profile_.get(); | 1762 return spellcheck_profile_.get(); |
| 1763 } | 1763 } |
| 1764 | 1764 |
| 1765 void ProfileImpl::SetDownloadManagerDelegate( | 1765 void ProfileImpl::SetDownloadManagerDelegate( |
| 1766 ChromeDownloadManagerDelegate* delegate) { | 1766 ChromeDownloadManagerDelegate* delegate) { |
| 1767 download_manager_delegate_ = delegate; | 1767 download_manager_delegate_ = delegate; |
| 1768 } | 1768 } |
| OLD | NEW |