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

Side by Side Diff: chrome/browser/content_settings/content_settings_default_provider.cc

Issue 545413002: Detach the dependency from host_content_settings_map to extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove ProviderType Created 6 years, 3 months 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
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/content_settings/content_settings_default_provider.h" 5 #include "chrome/browser/content_settings/content_settings_default_provider.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } 270 }
271 271
272 void DefaultProvider::ShutdownOnUIThread() { 272 void DefaultProvider::ShutdownOnUIThread() {
273 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 273 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
274 DCHECK(prefs_); 274 DCHECK(prefs_);
275 RemoveAllObservers(); 275 RemoveAllObservers();
276 pref_change_registrar_.RemoveAll(); 276 pref_change_registrar_.RemoveAll();
277 prefs_ = NULL; 277 prefs_ = NULL;
278 } 278 }
279 279
280 std::string DefaultProvider::GetProviderName() const {
281 return "default";
282 }
283
284 SettingSource DefaultProvider::GetSettingSource() const {
285 return SETTING_SOURCE_USER;
286 }
287
280 void DefaultProvider::OnPreferenceChanged(const std::string& name) { 288 void DefaultProvider::OnPreferenceChanged(const std::string& name) {
281 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 289 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
282 if (updating_preferences_) 290 if (updating_preferences_)
283 return; 291 return;
284 292
285 if (name == prefs::kDefaultContentSettings) { 293 if (name == prefs::kDefaultContentSettings) {
286 ReadDefaultSettings(true); 294 ReadDefaultSettings(true);
287 } else { 295 } else {
288 NOTREACHED() << "Unexpected preference observed"; 296 NOTREACHED() << "Unexpected preference observed";
289 return; 297 return;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 // Migrate obsolete cookie prompt mode. 348 // Migrate obsolete cookie prompt mode.
341 if (ValueToContentSetting( 349 if (ValueToContentSetting(
342 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()) == 350 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()) ==
343 CONTENT_SETTING_ASK) { 351 CONTENT_SETTING_ASK) {
344 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].reset( 352 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].reset(
345 new base::FundamentalValue(CONTENT_SETTING_BLOCK)); 353 new base::FundamentalValue(CONTENT_SETTING_BLOCK));
346 } 354 }
347 } 355 }
348 356
349 } // namespace content_settings 357 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698