Update mojo surfaces bindings and mojo/cc/ glue
[chromium-blink-merge.git] / chrome / browser / content_settings / content_settings_mock_provider.cc
blobab7c4d910bf05f164319d77698fe4af5817053bc
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
3 // found in the LICENSE file.
5 #include "chrome/browser/content_settings/content_settings_mock_provider.h"
7 namespace content_settings {
9 MockProvider::MockProvider()
10 : read_only_(false) {}
12 MockProvider::MockProvider(bool read_only)
13 : read_only_(read_only) {
16 MockProvider::~MockProvider() {}
18 RuleIterator* MockProvider::GetRuleIterator(
19 ContentSettingsType content_type,
20 const ResourceIdentifier& resource_identifier,
21 bool incognito) const {
22 return value_map_.GetRuleIterator(content_type, resource_identifier, NULL);
25 bool MockProvider::SetWebsiteSetting(
26 const ContentSettingsPattern& requesting_url_pattern,
27 const ContentSettingsPattern& embedding_url_pattern,
28 ContentSettingsType content_type,
29 const ResourceIdentifier& resource_identifier,
30 base::Value* value) {
31 if (read_only_)
32 return false;
33 value_map_.clear();
34 value_map_.SetValue(requesting_url_pattern,
35 embedding_url_pattern,
36 content_type,
37 resource_identifier,
38 value);
39 return true;
42 void MockProvider::ShutdownOnUIThread() {
43 RemoveAllObservers();
46 } // namespace content_settings