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 "chrome/browser/extensions/api/declarative/rules_registry_service.h" | 5 #include "chrome/browser/extensions/api/declarative/rules_registry_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "chrome/browser/extensions/api/declarative/initializing_rules_registry.
h" | 9 #include "chrome/browser/extensions/api/declarative/initializing_rules_registry.
h" |
10 #include "chrome/browser/extensions/api/declarative/rules_registry_storage_deleg
ate.h" | 10 #include "chrome/browser/extensions/api/declarative/rules_registry_storage_deleg
ate.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 RulesRegistryService::~RulesRegistryService() { | 51 RulesRegistryService::~RulesRegistryService() { |
52 for (size_t i = 0; i < delegates_.size(); ++i) | 52 for (size_t i = 0; i < delegates_.size(); ++i) |
53 delegates_[i]->CleanupOnUIThread(); | 53 delegates_[i]->CleanupOnUIThread(); |
54 } | 54 } |
55 | 55 |
56 void RulesRegistryService::RegisterDefaultRulesRegistries() { | 56 void RulesRegistryService::RegisterDefaultRulesRegistries() { |
57 RulesRegistryStorageDelegate* delegate = new RulesRegistryStorageDelegate(); | 57 RulesRegistryStorageDelegate* delegate = new RulesRegistryStorageDelegate(); |
58 scoped_refptr<WebRequestRulesRegistry> web_request_rules_registry( | 58 scoped_refptr<WebRequestRulesRegistry> web_request_rules_registry( |
59 new WebRequestRulesRegistry(profile_, delegate)); | 59 new WebRequestRulesRegistry(profile_, delegate)); |
60 delegate->InitOnUIThread(profile_, web_request_rules_registry, | 60 delegate->InitOnUIThread(profile_, web_request_rules_registry.get(), |
61 GetDeclarativeRuleStorageKey( | 61 GetDeclarativeRuleStorageKey( |
62 declarative_webrequest_constants::kOnRequest, | 62 declarative_webrequest_constants::kOnRequest, |
63 profile_->IsOffTheRecord())); | 63 profile_->IsOffTheRecord())); |
64 delegates_.push_back(delegate); | 64 delegates_.push_back(delegate); |
65 | 65 |
66 RegisterRulesRegistry(declarative_webrequest_constants::kOnRequest, | 66 RegisterRulesRegistry(declarative_webrequest_constants::kOnRequest, |
67 web_request_rules_registry); | 67 web_request_rules_registry); |
68 content::BrowserThread::PostTask( | 68 content::BrowserThread::PostTask( |
69 content::BrowserThread::IO, FROM_HERE, | 69 content::BrowserThread::IO, FROM_HERE, |
70 base::Bind(&RegisterToExtensionWebRequestEventRouterOnIO, | 70 base::Bind(&RegisterToExtensionWebRequestEventRouterOnIO, |
71 profile_, web_request_rules_registry)); | 71 profile_, web_request_rules_registry)); |
72 } | 72 } |
73 | 73 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 OnExtensionUnloaded(extension->id()); | 126 OnExtensionUnloaded(extension->id()); |
127 break; | 127 break; |
128 } | 128 } |
129 default: | 129 default: |
130 NOTREACHED(); | 130 NOTREACHED(); |
131 break; | 131 break; |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 } // namespace extensions | 135 } // namespace extensions |
OLD | NEW |