Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 11316163: Remove the last usages of PrefObserver outside of Prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 params->profile = profile; 187 params->profile = profile;
188 profile_params_.reset(params.release()); 188 profile_params_.reset(params.release());
189 189
190 ChromeNetworkDelegate::InitializePrefsOnUIThread( 190 ChromeNetworkDelegate::InitializePrefsOnUIThread(
191 &enable_referrers_, 191 &enable_referrers_,
192 &enable_do_not_track_, 192 &enable_do_not_track_,
193 &force_safesearch_, 193 &force_safesearch_,
194 pref_service); 194 pref_service);
195 195
196 #if defined(ENABLE_PRINTING) 196 #if defined(ENABLE_PRINTING)
197 printing_enabled_.Init(prefs::kPrintingEnabled, pref_service, NULL); 197 printing_enabled_.Init(prefs::kPrintingEnabled, pref_service);
198 printing_enabled_.MoveToThread( 198 printing_enabled_.MoveToThread(
199 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 199 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
200 #endif 200 #endif
201 chrome_http_user_agent_settings_.reset( 201 chrome_http_user_agent_settings_.reset(
202 new ChromeHttpUserAgentSettings(pref_service)); 202 new ChromeHttpUserAgentSettings(pref_service));
203 203
204 // These members are used only for one click sign in, which is not enabled 204 // These members are used only for one click sign in, which is not enabled
205 // in incognito mode. So no need to initialize them. 205 // in incognito mode. So no need to initialize them.
206 if (!is_incognito()) { 206 if (!is_incognito()) {
207 signin_names_.reset(new SigninNamesOnIOThread()); 207 signin_names_.reset(new SigninNamesOnIOThread());
208 208
209 google_services_username_.Init(prefs::kGoogleServicesUsername, pref_service, 209 google_services_username_.Init(prefs::kGoogleServicesUsername, pref_service) ;
Mattias Nissler (ping if slow) 2012/12/04 10:47:12 nit: overlong line
Jói 2012/12/04 10:55:57 Done.
210 NULL);
211 google_services_username_.MoveToThread( 210 google_services_username_.MoveToThread(
212 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 211 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
213 212
214 google_services_username_pattern_.Init( 213 google_services_username_pattern_.Init(
215 prefs::kGoogleServicesUsernamePattern, local_state_pref_service, NULL); 214 prefs::kGoogleServicesUsernamePattern, local_state_pref_service);
216 google_services_username_pattern_.MoveToThread( 215 google_services_username_pattern_.MoveToThread(
217 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 216 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
218 217
219 reverse_autologin_enabled_.Init( 218 reverse_autologin_enabled_.Init(
220 prefs::kReverseAutologinEnabled, pref_service, NULL); 219 prefs::kReverseAutologinEnabled, pref_service);
221 reverse_autologin_enabled_.MoveToThread( 220 reverse_autologin_enabled_.MoveToThread(
222 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 221 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
223 222
224 one_click_signin_rejected_email_list_.Init( 223 one_click_signin_rejected_email_list_.Init(
225 prefs::kReverseAutologinRejectedEmailList, pref_service, NULL); 224 prefs::kReverseAutologinRejectedEmailList, pref_service);
226 one_click_signin_rejected_email_list_.MoveToThread( 225 one_click_signin_rejected_email_list_.MoveToThread(
227 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 226 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
228 } 227 }
229 228
230 // The URLBlacklistManager has to be created on the UI thread to register 229 // The URLBlacklistManager has to be created on the UI thread to register
231 // observers of |pref_service|, and it also has to clean up on 230 // observers of |pref_service|, and it also has to clean up on
232 // ShutdownOnUIThread to release these observers on the right thread. 231 // ShutdownOnUIThread to release these observers on the right thread.
233 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, 232 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up,
234 // in particular when this ProfileIOData isn't |initialized_| during deletion. 233 // in particular when this ProfileIOData isn't |initialized_| during deletion.
235 #if defined(ENABLE_CONFIGURATION_POLICY) 234 #if defined(ENABLE_CONFIGURATION_POLICY)
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 // Just fetch the value from ChromeOS' settings while we're on the UI thread. 449 // Just fetch the value from ChromeOS' settings while we're on the UI thread.
451 // TODO(stevet): For now, this value is only set on profile initialization. 450 // TODO(stevet): For now, this value is only set on profile initialization.
452 // We will want to do something similar to the PrefMember method below in the 451 // We will want to do something similar to the PrefMember method below in the
453 // future to more accurately capture this state. 452 // future to more accurately capture this state.
454 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref, 453 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref,
455 &enable_metrics_); 454 &enable_metrics_);
456 #else 455 #else
457 // Prep the PrefMember and send it to the IO thread, since this value will be 456 // Prep the PrefMember and send it to the IO thread, since this value will be
458 // read from there. 457 // read from there.
459 enable_metrics_.Init(prefs::kMetricsReportingEnabled, 458 enable_metrics_.Init(prefs::kMetricsReportingEnabled,
460 g_browser_process->local_state(), 459 g_browser_process->local_state());
461 NULL);
462 enable_metrics_.MoveToThread( 460 enable_metrics_.MoveToThread(
463 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 461 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
464 #endif // defined(OS_CHROMEOS) 462 #endif // defined(OS_CHROMEOS)
465 } 463 }
466 464
467 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const { 465 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const {
468 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 466 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
469 #if defined(OS_CHROMEOS) 467 #if defined(OS_CHROMEOS)
470 return enable_metrics_; 468 return enable_metrics_;
471 #else 469 #else
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 void ProfileIOData::SetCookieSettingsForTesting( 747 void ProfileIOData::SetCookieSettingsForTesting(
750 CookieSettings* cookie_settings) { 748 CookieSettings* cookie_settings) {
751 DCHECK(!cookie_settings_.get()); 749 DCHECK(!cookie_settings_.get());
752 cookie_settings_ = cookie_settings; 750 cookie_settings_ = cookie_settings;
753 } 751 }
754 752
755 void ProfileIOData::set_signin_names_for_testing( 753 void ProfileIOData::set_signin_names_for_testing(
756 SigninNamesOnIOThread* signin_names) { 754 SigninNamesOnIOThread* signin_names) {
757 signin_names_.reset(signin_names); 755 signin_names_.reset(signin_names);
758 } 756 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698