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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #include "chrome/browser/policy/configuration_policy_pref_store.h" | 53 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
54 #include "chrome/browser/prefs/browser_prefs.h" | 54 #include "chrome/browser/prefs/browser_prefs.h" |
55 #include "chrome/browser/prefs/pref_value_store.h" | 55 #include "chrome/browser/prefs/pref_value_store.h" |
56 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 56 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
57 #include "chrome/browser/prerender/prerender_manager.h" | 57 #include "chrome/browser/prerender/prerender_manager.h" |
58 #include "chrome/browser/profiles/profile_dependency_manager.h" | 58 #include "chrome/browser/profiles/profile_dependency_manager.h" |
59 #include "chrome/browser/profiles/profile_manager.h" | 59 #include "chrome/browser/profiles/profile_manager.h" |
60 #include "chrome/browser/search_engines/template_url_fetcher.h" | 60 #include "chrome/browser/search_engines/template_url_fetcher.h" |
61 #include "chrome/browser/search_engines/template_url_service.h" | 61 #include "chrome/browser/search_engines/template_url_service.h" |
62 #include "chrome/browser/sessions/session_service_factory.h" | 62 #include "chrome/browser/sessions/session_service_factory.h" |
| 63 #include "chrome/browser/speech/chrome_speech_input_manager.h" |
63 #include "chrome/browser/spellchecker/spellcheck_profile.h" | 64 #include "chrome/browser/spellchecker/spellcheck_profile.h" |
64 #include "chrome/browser/sync/profile_sync_factory_impl.h" | 65 #include "chrome/browser/sync/profile_sync_factory_impl.h" |
65 #include "chrome/browser/sync/profile_sync_service.h" | 66 #include "chrome/browser/sync/profile_sync_service.h" |
66 #include "chrome/browser/tabs/pinned_tab_service_factory.h" | 67 #include "chrome/browser/tabs/pinned_tab_service_factory.h" |
67 #include "chrome/browser/transport_security_persister.h" | 68 #include "chrome/browser/transport_security_persister.h" |
68 #include "chrome/browser/ui/browser_list.h" | 69 #include "chrome/browser/ui/browser_list.h" |
69 #include "chrome/browser/ui/find_bar/find_bar_state.h" | 70 #include "chrome/browser/ui/find_bar/find_bar_state.h" |
70 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 71 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
71 #include "chrome/browser/ui/webui/extension_icon_source.h" | 72 #include "chrome/browser/ui/webui/extension_icon_source.h" |
72 #include "chrome/browser/user_style_sheet_watcher.h" | 73 #include "chrome/browser/user_style_sheet_watcher.h" |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 new ProfileSizeTask(path_), 112000); | 402 new ProfileSizeTask(path_), 112000); |
402 | 403 |
403 InstantController::RecordMetrics(this); | 404 InstantController::RecordMetrics(this); |
404 | 405 |
405 // Instantiates Metrics object for spellchecking for use. | 406 // Instantiates Metrics object for spellchecking for use. |
406 if (g_browser_process->metrics_service() && | 407 if (g_browser_process->metrics_service() && |
407 g_browser_process->metrics_service()->recording_active()) | 408 g_browser_process->metrics_service()->recording_active()) |
408 GetSpellCheckProfile()->StartRecordingMetrics( | 409 GetSpellCheckProfile()->StartRecordingMetrics( |
409 GetPrefs()->GetBoolean(prefs::kEnableSpellCheck)); | 410 GetPrefs()->GetBoolean(prefs::kEnableSpellCheck)); |
410 | 411 |
411 speech_input::SpeechInputManager::Get()->set_censor_results( | 412 speech_input::ChromeSpeechInputManager::GetInstance()->set_censor_results( |
412 prefs->GetBoolean(prefs::kSpeechInputCensorResults)); | 413 prefs->GetBoolean(prefs::kSpeechInputCensorResults)); |
413 | 414 |
414 FilePath cookie_path = GetPath(); | 415 FilePath cookie_path = GetPath(); |
415 cookie_path = cookie_path.Append(chrome::kCookieFilename); | 416 cookie_path = cookie_path.Append(chrome::kCookieFilename); |
416 FilePath origin_bound_cert_path = GetPath(); | 417 FilePath origin_bound_cert_path = GetPath(); |
417 origin_bound_cert_path = | 418 origin_bound_cert_path = |
418 origin_bound_cert_path.Append(chrome::kOBCertFilename); | 419 origin_bound_cert_path.Append(chrome::kOBCertFilename); |
419 FilePath cache_path = base_cache_path_; | 420 FilePath cache_path = base_cache_path_; |
420 int cache_max_size; | 421 int cache_max_size; |
421 GetCacheParameters(kNormalContext, &cache_path, &cache_max_size); | 422 GetCacheParameters(kNormalContext, &cache_path, &cache_max_size); |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 ReinitializeSpellCheckHost(true); | 1450 ReinitializeSpellCheckHost(true); |
1450 } else if (*pref_name_in == prefs::kEnableAutoSpellCorrect) { | 1451 } else if (*pref_name_in == prefs::kEnableAutoSpellCorrect) { |
1451 bool enabled = prefs->GetBoolean(prefs::kEnableAutoSpellCorrect); | 1452 bool enabled = prefs->GetBoolean(prefs::kEnableAutoSpellCorrect); |
1452 for (RenderProcessHost::iterator | 1453 for (RenderProcessHost::iterator |
1453 i(RenderProcessHost::AllHostsIterator()); | 1454 i(RenderProcessHost::AllHostsIterator()); |
1454 !i.IsAtEnd(); i.Advance()) { | 1455 !i.IsAtEnd(); i.Advance()) { |
1455 RenderProcessHost* process = i.GetCurrentValue(); | 1456 RenderProcessHost* process = i.GetCurrentValue(); |
1456 process->Send(new SpellCheckMsg_EnableAutoSpellCorrect(enabled)); | 1457 process->Send(new SpellCheckMsg_EnableAutoSpellCorrect(enabled)); |
1457 } | 1458 } |
1458 } else if (*pref_name_in == prefs::kSpeechInputCensorResults) { | 1459 } else if (*pref_name_in == prefs::kSpeechInputCensorResults) { |
1459 speech_input::SpeechInputManager::Get()->set_censor_results( | 1460 speech_input::ChromeSpeechInputManager::GetInstance()-> |
1460 prefs->GetBoolean(prefs::kSpeechInputCensorResults)); | 1461 set_censor_results(prefs->GetBoolean( |
| 1462 prefs::kSpeechInputCensorResults)); |
1461 } else if (*pref_name_in == prefs::kClearSiteDataOnExit) { | 1463 } else if (*pref_name_in == prefs::kClearSiteDataOnExit) { |
1462 clear_local_state_on_exit_ = | 1464 clear_local_state_on_exit_ = |
1463 prefs->GetBoolean(prefs::kClearSiteDataOnExit); | 1465 prefs->GetBoolean(prefs::kClearSiteDataOnExit); |
1464 if (webkit_context_) { | 1466 if (webkit_context_) { |
1465 webkit_context_->set_clear_local_state_on_exit( | 1467 webkit_context_->set_clear_local_state_on_exit( |
1466 clear_local_state_on_exit_); | 1468 clear_local_state_on_exit_); |
1467 } | 1469 } |
1468 if (db_tracker_) { | 1470 if (db_tracker_) { |
1469 db_tracker_->SetClearLocalStateOnExit( | 1471 db_tracker_->SetClearLocalStateOnExit( |
1470 clear_local_state_on_exit_); | 1472 clear_local_state_on_exit_); |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1721 #endif | 1723 #endif |
1722 } | 1724 } |
1723 return prerender_manager_.get(); | 1725 return prerender_manager_.get(); |
1724 } | 1726 } |
1725 | 1727 |
1726 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { | 1728 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { |
1727 if (!spellcheck_profile_.get()) | 1729 if (!spellcheck_profile_.get()) |
1728 spellcheck_profile_.reset(new SpellCheckProfile()); | 1730 spellcheck_profile_.reset(new SpellCheckProfile()); |
1729 return spellcheck_profile_.get(); | 1731 return spellcheck_profile_.get(); |
1730 } | 1732 } |
OLD | NEW |