| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_mock_provider.h" | 5 #include "chrome/browser/content_settings/content_settings_mock_provider.h" |
| 6 | 6 |
| 7 namespace content_settings { | 7 namespace content_settings { |
| 8 | 8 |
| 9 MockProvider::MockProvider() | 9 MockProvider::MockProvider() |
| 10 : read_only_(false) {} | 10 : read_only_(false) {} |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 MockProvider::~MockProvider() {} | 27 MockProvider::~MockProvider() {} |
| 28 | 28 |
| 29 RuleIterator* MockProvider::GetRuleIterator( | 29 RuleIterator* MockProvider::GetRuleIterator( |
| 30 ContentSettingsType content_type, | 30 ContentSettingsType content_type, |
| 31 const ResourceIdentifier& resource_identifier, | 31 const ResourceIdentifier& resource_identifier, |
| 32 bool incognito) const { | 32 bool incognito) const { |
| 33 return value_map_.GetRuleIterator(content_type, resource_identifier, NULL); | 33 return value_map_.GetRuleIterator(content_type, resource_identifier, NULL); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void MockProvider::SetContentSetting( | 36 bool MockProvider::SetWebsiteSetting( |
| 37 const ContentSettingsPattern& requesting_url_pattern, | 37 const ContentSettingsPattern& requesting_url_pattern, |
| 38 const ContentSettingsPattern& embedding_url_pattern, | 38 const ContentSettingsPattern& embedding_url_pattern, |
| 39 ContentSettingsType content_type, | 39 ContentSettingsType content_type, |
| 40 const ResourceIdentifier& resource_identifier, | 40 const ResourceIdentifier& resource_identifier, |
| 41 ContentSetting content_setting) { | 41 base::Value* value) { |
| 42 if (read_only_) | 42 if (read_only_) |
| 43 return; | 43 return false; |
| 44 value_map_.clear(); | 44 value_map_.clear(); |
| 45 value_map_.SetValue(requesting_url_pattern, | 45 value_map_.SetValue(requesting_url_pattern, |
| 46 embedding_url_pattern, | 46 embedding_url_pattern, |
| 47 content_type, | 47 content_type, |
| 48 resource_identifier, | 48 resource_identifier, |
| 49 Value::CreateIntegerValue(content_setting)); | 49 value); |
| 50 return true; |
| 50 } | 51 } |
| 51 | 52 |
| 52 void MockProvider::ShutdownOnUIThread() { | 53 void MockProvider::ShutdownOnUIThread() { |
| 53 RemoveAllObservers(); | 54 RemoveAllObservers(); |
| 54 } | 55 } |
| 55 | 56 |
| 56 } // namespace content_settings | 57 } // namespace content_settings |
| OLD | NEW |