| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |