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

Side by Side Diff: chrome/browser/content_settings/content_settings_pref_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_pref_provider.h" 5 #include "chrome/browser/content_settings/content_settings_pref_provider.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 } 560 }
561 561
562 void PrefProvider::ShutdownOnUIThread() { 562 void PrefProvider::ShutdownOnUIThread() {
563 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 563 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
564 DCHECK(prefs_); 564 DCHECK(prefs_);
565 RemoveAllObservers(); 565 RemoveAllObservers();
566 pref_change_registrar_.RemoveAll(); 566 pref_change_registrar_.RemoveAll();
567 prefs_ = NULL; 567 prefs_ = NULL;
568 } 568 }
569 569
570 std::string PrefProvider::GetProviderName() const {
571 return "preference";
572 }
573
574 SettingSource PrefProvider::GetSettingSource() const {
575 return SETTING_SOURCE_USER;
576 }
577
570 void PrefProvider::UpdateLastUsage( 578 void PrefProvider::UpdateLastUsage(
571 const ContentSettingsPattern& primary_pattern, 579 const ContentSettingsPattern& primary_pattern,
572 const ContentSettingsPattern& secondary_pattern, 580 const ContentSettingsPattern& secondary_pattern,
573 ContentSettingsType content_type) { 581 ContentSettingsType content_type) {
574 // Don't write if in incognito. 582 // Don't write if in incognito.
575 if (is_incognito_) { 583 if (is_incognito_) {
576 return; 584 return;
577 } 585 }
578 586
579 // Ensure that |lock_| is not held by this thread, since this function will 587 // Ensure that |lock_| is not held by this thread, since this function will
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 lock_.Acquire(); 660 lock_.Acquire();
653 lock_.Release(); 661 lock_.Release();
654 #endif 662 #endif
655 } 663 }
656 664
657 void PrefProvider::SetClockForTesting(scoped_ptr<base::Clock> clock) { 665 void PrefProvider::SetClockForTesting(scoped_ptr<base::Clock> clock) {
658 clock_ = clock.Pass(); 666 clock_ = clock.Pass();
659 } 667 }
660 668
661 } // namespace content_settings 669 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698