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/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 2496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2507 for (ExtensionSet::const_iterator it = extensions_.begin(); | 2507 for (ExtensionSet::const_iterator it = extensions_.begin(); |
2508 it != extensions_.end(); ++it) { | 2508 it != extensions_.end(); ++it) { |
2509 if ((*it)->is_app() && (*it)->location() != Extension::COMPONENT) | 2509 if ((*it)->is_app() && (*it)->location() != Extension::COMPONENT) |
2510 result.insert((*it)->id()); | 2510 result.insert((*it)->id()); |
2511 } | 2511 } |
2512 | 2512 |
2513 return result; | 2513 return result; |
2514 } | 2514 } |
2515 | 2515 |
2516 bool ExtensionService::IsBackgroundPageReady(const Extension* extension) { | 2516 bool ExtensionService::IsBackgroundPageReady(const Extension* extension) { |
2517 return (!(extension->has_background_page() && | 2517 return (!extension->has_persistent_background_page() || |
2518 extension->background_page_persists()) || | |
2519 extension_runtime_data_[extension->id()].background_page_ready); | 2518 extension_runtime_data_[extension->id()].background_page_ready); |
2520 } | 2519 } |
2521 | 2520 |
2522 void ExtensionService::SetBackgroundPageReady(const Extension* extension) { | 2521 void ExtensionService::SetBackgroundPageReady(const Extension* extension) { |
2523 DCHECK(extension->has_background_page()); | 2522 DCHECK(extension->has_background_page()); |
2524 extension_runtime_data_[extension->id()].background_page_ready = true; | 2523 extension_runtime_data_[extension->id()].background_page_ready = true; |
2525 content::NotificationService::current()->Notify( | 2524 content::NotificationService::current()->Notify( |
2526 chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, | 2525 chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, |
2527 content::Source<const Extension>(extension), | 2526 content::Source<const Extension>(extension), |
2528 content::NotificationService::NoDetails()); | 2527 content::NotificationService::NoDetails()); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2641 return api_resource_controller_; | 2640 return api_resource_controller_; |
2642 } | 2641 } |
2643 | 2642 |
2644 extensions::RulesRegistryService* ExtensionService::GetRulesRegistryService() { | 2643 extensions::RulesRegistryService* ExtensionService::GetRulesRegistryService() { |
2645 if (!rules_registry_service_.get()) { | 2644 if (!rules_registry_service_.get()) { |
2646 rules_registry_service_.reset( | 2645 rules_registry_service_.reset( |
2647 new extensions::RulesRegistryService(profile_)); | 2646 new extensions::RulesRegistryService(profile_)); |
2648 } | 2647 } |
2649 return rules_registry_service_.get(); | 2648 return rules_registry_service_.get(); |
2650 } | 2649 } |
OLD | NEW |