| 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_custom_extension_prov
ider.h" | 5 #include "chrome/browser/content_settings/content_settings_custom_extension_prov
ider.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "chrome/browser/content_settings/content_settings_utils.h" | 8 #include "chrome/browser/content_settings/content_settings_utils.h" |
| 9 #include "chrome/browser/extensions/api/content_settings/content_settings_store.
h" | 9 #include "chrome/browser/extensions/api/content_settings/content_settings_store.
h" |
| 10 #include "chrome/common/content_settings_pattern.h" | 10 #include "chrome/common/content_settings_pattern.h" |
| 11 | 11 |
| 12 namespace content_settings { | 12 namespace content_settings { |
| 13 | 13 |
| 14 CustomExtensionProvider::CustomExtensionProvider( | 14 CustomExtensionProvider::CustomExtensionProvider( |
| 15 extensions::ContentSettingsStore* extensions_settings, | 15 const scoped_refptr<extensions::ContentSettingsStore>& extensions_settings, |
| 16 bool incognito) | 16 bool incognito) |
| 17 : incognito_(incognito), | 17 : incognito_(incognito), extensions_settings_(extensions_settings) { |
| 18 extensions_settings_(extensions_settings) { | |
| 19 extensions_settings_->AddObserver(this); | 18 extensions_settings_->AddObserver(this); |
| 20 } | 19 } |
| 21 | 20 |
| 22 CustomExtensionProvider::~CustomExtensionProvider() { | 21 CustomExtensionProvider::~CustomExtensionProvider() { |
| 23 } | 22 } |
| 24 | 23 |
| 25 RuleIterator* CustomExtensionProvider::GetRuleIterator( | 24 RuleIterator* CustomExtensionProvider::GetRuleIterator( |
| 26 ContentSettingsType content_type, | 25 ContentSettingsType content_type, |
| 27 const ResourceIdentifier& resource_identifier, | 26 const ResourceIdentifier& resource_identifier, |
| 28 bool incognito) const { | 27 bool incognito) const { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 51 if (incognito_ != incognito) | 50 if (incognito_ != incognito) |
| 52 return; | 51 return; |
| 53 // TODO(markusheintz): Be more concise. | 52 // TODO(markusheintz): Be more concise. |
| 54 NotifyObservers(ContentSettingsPattern(), | 53 NotifyObservers(ContentSettingsPattern(), |
| 55 ContentSettingsPattern(), | 54 ContentSettingsPattern(), |
| 56 CONTENT_SETTINGS_TYPE_DEFAULT, | 55 CONTENT_SETTINGS_TYPE_DEFAULT, |
| 57 std::string()); | 56 std::string()); |
| 58 } | 57 } |
| 59 | 58 |
| 60 } // namespace content_settings | 59 } // namespace content_settings |
| OLD | NEW |