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

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

Issue 49693003: Refactor RulesRegistryWithCache to RulesRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nits 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 : RulesRegistry(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 18
19 TestRulesRegistry::TestRulesRegistry( 19 TestRulesRegistry::TestRulesRegistry(
20 Profile* profile, 20 Profile* profile,
21 const std::string& event_name, 21 const std::string& event_name,
22 content::BrowserThread::ID owner_thread, 22 content::BrowserThread::ID owner_thread,
23 scoped_ptr<RulesRegistryWithCache::RuleStorageOnUI>* ui_part) 23 scoped_ptr<RulesCacheDelegate>* ui_part)
24 : RulesRegistryWithCache(profile, 24 : RulesRegistry(profile,
25 event_name, 25 event_name,
26 owner_thread, 26 owner_thread,
27 false /*log_storage_init_delay*/, 27 false /*log_storage_init_delay*/,
28 ui_part) {} 28 ui_part) {}
29 29
30 std::string TestRulesRegistry::AddRulesImpl( 30 std::string TestRulesRegistry::AddRulesImpl(
31 const std::string& extension_id, 31 const std::string& extension_id,
32 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) { 32 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) {
33 return result_; 33 return result_;
34 } 34 }
35 35
36 std::string TestRulesRegistry::RemoveRulesImpl( 36 std::string TestRulesRegistry::RemoveRulesImpl(
37 const std::string& extension_id, 37 const std::string& extension_id,
38 const std::vector<std::string>& rule_identifiers) { 38 const std::vector<std::string>& rule_identifiers) {
39 return result_; 39 return result_;
40 } 40 }
41 41
42 std::string TestRulesRegistry::RemoveAllRulesImpl( 42 std::string TestRulesRegistry::RemoveAllRulesImpl(
43 const std::string& extension_id) { 43 const std::string& extension_id) {
44 return result_; 44 return result_;
45 } 45 }
46 46
47 void TestRulesRegistry::SetResult(const std::string& result) { 47 void TestRulesRegistry::SetResult(const std::string& result) {
48 result_ = result; 48 result_ = result;
49 } 49 }
50 50
51 TestRulesRegistry::~TestRulesRegistry() {} 51 TestRulesRegistry::~TestRulesRegistry() {}
52 52
53 } // namespace extensions 53 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698