| 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 <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 : RulesRegistry(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 NULL) {} |
| 17 NULL /*ui_part*/) {} | |
| 18 | 17 |
| 19 TestRulesRegistry::TestRulesRegistry( | 18 TestRulesRegistry::TestRulesRegistry( |
| 20 Profile* profile, | 19 Profile* profile, |
| 21 const std::string& event_name, | 20 const std::string& event_name, |
| 22 content::BrowserThread::ID owner_thread, | 21 content::BrowserThread::ID owner_thread, |
| 23 scoped_ptr<RulesCacheDelegate>* ui_part) | 22 RulesCacheDelegate* cache_delegate) |
| 24 : RulesRegistry(profile, | 23 : RulesRegistry(profile, |
| 25 event_name, | 24 event_name, |
| 26 owner_thread, | 25 owner_thread, |
| 27 false /*log_storage_init_delay*/, | 26 cache_delegate) {} |
| 28 ui_part) {} | |
| 29 | 27 |
| 30 std::string TestRulesRegistry::AddRulesImpl( | 28 std::string TestRulesRegistry::AddRulesImpl( |
| 31 const std::string& extension_id, | 29 const std::string& extension_id, |
| 32 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) { | 30 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) { |
| 33 return result_; | 31 return result_; |
| 34 } | 32 } |
| 35 | 33 |
| 36 std::string TestRulesRegistry::RemoveRulesImpl( | 34 std::string TestRulesRegistry::RemoveRulesImpl( |
| 37 const std::string& extension_id, | 35 const std::string& extension_id, |
| 38 const std::vector<std::string>& rule_identifiers) { | 36 const std::vector<std::string>& rule_identifiers) { |
| 39 return result_; | 37 return result_; |
| 40 } | 38 } |
| 41 | 39 |
| 42 std::string TestRulesRegistry::RemoveAllRulesImpl( | 40 std::string TestRulesRegistry::RemoveAllRulesImpl( |
| 43 const std::string& extension_id) { | 41 const std::string& extension_id) { |
| 44 return result_; | 42 return result_; |
| 45 } | 43 } |
| 46 | 44 |
| 47 void TestRulesRegistry::SetResult(const std::string& result) { | 45 void TestRulesRegistry::SetResult(const std::string& result) { |
| 48 result_ = result; | 46 result_ = result; |
| 49 } | 47 } |
| 50 | 48 |
| 51 TestRulesRegistry::~TestRulesRegistry() {} | 49 TestRulesRegistry::~TestRulesRegistry() {} |
| 52 | 50 |
| 53 } // namespace extensions | 51 } // namespace extensions |
| OLD | NEW |