| 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_content/content_rules_regist
ry.h" | 5 #include "chrome/browser/extensions/api/declarative_content/content_rules_regist
ry.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/extensions/api/declarative_content/content_action.h" | 8 #include "chrome/browser/extensions/api/declarative_content/content_action.h" |
| 9 #include "chrome/browser/extensions/api/declarative_content/content_condition.h" | 9 #include "chrome/browser/extensions/api/declarative_content/content_condition.h" |
| 10 #include "chrome/browser/extensions/api/declarative_content/content_constants.h" | 10 #include "chrome/browser/extensions/api/declarative_content/content_constants.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "chrome/browser/extensions/extension_system.h" | 12 #include "chrome/browser/extensions/extension_system.h" |
| 13 #include "chrome/browser/extensions/extension_tab_util.h" | 13 #include "chrome/browser/extensions/extension_tab_util.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/common/extensions/extension_messages.h" | 15 #include "chrome/common/extensions/extension_messages.h" |
| 16 #include "content/public/browser/navigation_details.h" | 16 #include "content/public/browser/navigation_details.h" |
| 17 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
| 18 #include "content/public/browser/notification_source.h" | 18 #include "content/public/browser/notification_source.h" |
| 19 #include "content/public/browser/render_process_host.h" | 19 #include "content/public/browser/render_process_host.h" |
| 20 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 21 | 21 |
| 22 namespace extensions { | 22 namespace extensions { |
| 23 | 23 |
| 24 ContentRulesRegistry::ContentRulesRegistry(Profile* profile, | 24 ContentRulesRegistry::ContentRulesRegistry(Profile* profile, |
| 25 RulesCacheDelegate* cache_delegate) | 25 RulesCacheDelegate* cache_delegate) |
| 26 : RulesRegistry(profile, | 26 : RulesRegistry(profile, |
| 27 declarative_content_constants::kOnPageChanged, | 27 declarative_content_constants::kOnPageChanged, |
| 28 content::BrowserThread::UI, | 28 content::BrowserThread::UI, |
| 29 cache_delegate) { | 29 cache_delegate, |
| 30 WebViewKey(0, 0)) { |
| 30 extension_info_map_ = ExtensionSystem::Get(profile)->info_map(); | 31 extension_info_map_ = ExtensionSystem::Get(profile)->info_map(); |
| 31 | 32 |
| 32 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED, | 33 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED, |
| 33 content::NotificationService::AllBrowserContextsAndSources()); | 34 content::NotificationService::AllBrowserContextsAndSources()); |
| 34 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 35 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 35 content::NotificationService::AllBrowserContextsAndSources()); | 36 content::NotificationService::AllBrowserContextsAndSources()); |
| 36 } | 37 } |
| 37 | 38 |
| 38 void ContentRulesRegistry::Observe( | 39 void ContentRulesRegistry::Observe( |
| 39 int type, | 40 int type, |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 | 310 |
| 310 base::Time ContentRulesRegistry::GetExtensionInstallationTime( | 311 base::Time ContentRulesRegistry::GetExtensionInstallationTime( |
| 311 const std::string& extension_id) const { | 312 const std::string& extension_id) const { |
| 312 if (!extension_info_map_.get()) // May be NULL during testing. | 313 if (!extension_info_map_.get()) // May be NULL during testing. |
| 313 return base::Time(); | 314 return base::Time(); |
| 314 | 315 |
| 315 return extension_info_map_->GetInstallTime(extension_id); | 316 return extension_info_map_->GetInstallTime(extension_id); |
| 316 } | 317 } |
| 317 | 318 |
| 318 } // namespace extensions | 319 } // namespace extensions |
| OLD | NEW |