OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_override_provider.h" | 5 #include "chrome/browser/content_settings/content_settings_override_provider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 using content::BrowserThread; | 21 using content::BrowserThread; |
22 | 22 |
23 namespace content_settings { | 23 namespace content_settings { |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 class OverrideRuleIterator : public RuleIterator { | 27 class OverrideRuleIterator : public RuleIterator { |
28 public: | 28 public: |
29 explicit OverrideRuleIterator(bool is_allowed) : is_done_(is_allowed) {} | 29 explicit OverrideRuleIterator(bool is_allowed) : is_done_(is_allowed) {} |
30 | 30 |
31 virtual bool HasNext() const OVERRIDE { return !is_done_; } | 31 virtual bool HasNext() const override { return !is_done_; } |
32 | 32 |
33 virtual Rule Next() OVERRIDE { | 33 virtual Rule Next() override { |
34 DCHECK(!is_done_); | 34 DCHECK(!is_done_); |
35 is_done_ = true; | 35 is_done_ = true; |
36 return Rule(ContentSettingsPattern::Wildcard(), | 36 return Rule(ContentSettingsPattern::Wildcard(), |
37 ContentSettingsPattern::Wildcard(), | 37 ContentSettingsPattern::Wildcard(), |
38 new base::FundamentalValue(CONTENT_SETTING_BLOCK)); | 38 new base::FundamentalValue(CONTENT_SETTING_BLOCK)); |
39 } | 39 } |
40 | 40 |
41 private: | 41 private: |
42 bool is_done_; | 42 bool is_done_; |
43 }; | 43 }; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 prefs_->GetDictionary(prefs::kOverrideContentSettings); | 125 prefs_->GetDictionary(prefs::kOverrideContentSettings); |
126 | 126 |
127 for (int type = 0; type < CONTENT_SETTINGS_NUM_TYPES; ++type) { | 127 for (int type = 0; type < CONTENT_SETTINGS_NUM_TYPES; ++type) { |
128 ContentSettingsType content_setting = ContentSettingsType(type); | 128 ContentSettingsType content_setting = ContentSettingsType(type); |
129 allowed_settings_[content_setting] = | 129 allowed_settings_[content_setting] = |
130 !blocked_settings_dictionary->HasKey(GetTypeName(content_setting)); | 130 !blocked_settings_dictionary->HasKey(GetTypeName(content_setting)); |
131 } | 131 } |
132 } | 132 } |
133 | 133 |
134 } // namespace content_settings | 134 } // namespace content_settings |
OLD | NEW |