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