Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1251)

Side by Side Diff: chrome/browser/extensions/api/declarative/test_rules_registry.cc

Issue 28273006: <webview>: Implement declarativeWebRequest API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added tests Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 5 #include <string>
6 6
7 #include "chrome/browser/extensions/api/declarative/test_rules_registry.h" 7 #include "chrome/browser/extensions/api/declarative/test_rules_registry.h"
8 8
9 namespace extensions { 9 namespace extensions {
10 10
11 TestRulesRegistry::TestRulesRegistry(content::BrowserThread::ID owner_thread, 11 TestRulesRegistry::TestRulesRegistry(content::BrowserThread::ID owner_thread,
12 const std::string& event_name) 12 const std::string& event_name)
13 : RulesRegistryWithCache(NULL /*profile*/, 13 : RulesRegistryWithCache(NULL /*profile*/,
14 event_name, 14 event_name,
15 owner_thread, 15 owner_thread,
16 false /*log_storage_init_delay, this is ignored*/, 16 false /*log_storage_init_delay, this is ignored*/,
17 NULL /*ui_part*/) {} 17 NULL /*ui_part*/,
18 WebViewKey(0, 0)) {}
18 19
19 TestRulesRegistry::TestRulesRegistry( 20 TestRulesRegistry::TestRulesRegistry(
20 Profile* profile, 21 Profile* profile,
21 const std::string& event_name, 22 const std::string& event_name,
22 content::BrowserThread::ID owner_thread, 23 content::BrowserThread::ID owner_thread,
23 scoped_ptr<RulesRegistryWithCache::RuleStorageOnUI>* ui_part) 24 scoped_ptr<RulesRegistryWithCache::RuleStorageOnUI>* ui_part)
24 : RulesRegistryWithCache(profile, 25 : RulesRegistryWithCache(profile,
25 event_name, 26 event_name,
26 owner_thread, 27 owner_thread,
27 false /*log_storage_init_delay*/, 28 false /*log_storage_init_delay*/,
28 ui_part) {} 29 ui_part,
30 WebViewKey(0, 0)) {}
29 31
30 std::string TestRulesRegistry::AddRulesImpl( 32 std::string TestRulesRegistry::AddRulesImpl(
31 const std::string& extension_id, 33 const std::string& extension_id,
32 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) { 34 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) {
33 return result_; 35 return result_;
34 } 36 }
35 37
36 std::string TestRulesRegistry::RemoveRulesImpl( 38 std::string TestRulesRegistry::RemoveRulesImpl(
37 const std::string& extension_id, 39 const std::string& extension_id,
38 const std::vector<std::string>& rule_identifiers) { 40 const std::vector<std::string>& rule_identifiers) {
39 return result_; 41 return result_;
40 } 42 }
41 43
42 std::string TestRulesRegistry::RemoveAllRulesImpl( 44 std::string TestRulesRegistry::RemoveAllRulesImpl(
43 const std::string& extension_id) { 45 const std::string& extension_id) {
44 return result_; 46 return result_;
45 } 47 }
46 48
47 void TestRulesRegistry::SetResult(const std::string& result) { 49 void TestRulesRegistry::SetResult(const std::string& result) {
48 result_ = result; 50 result_ = result;
49 } 51 }
50 52
51 TestRulesRegistry::~TestRulesRegistry() {} 53 TestRulesRegistry::~TestRulesRegistry() {}
52 54
53 } // namespace extensions 55 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698