| 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 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2471 for (ExtensionSet::const_iterator it = extensions_.begin(); | 2471 for (ExtensionSet::const_iterator it = extensions_.begin(); |
| 2472 it != extensions_.end(); ++it) { | 2472 it != extensions_.end(); ++it) { |
| 2473 if ((*it)->is_app() && (*it)->location() != Extension::COMPONENT) | 2473 if ((*it)->is_app() && (*it)->location() != Extension::COMPONENT) |
| 2474 result.insert((*it)->id()); | 2474 result.insert((*it)->id()); |
| 2475 } | 2475 } |
| 2476 | 2476 |
| 2477 return result; | 2477 return result; |
| 2478 } | 2478 } |
| 2479 | 2479 |
| 2480 bool ExtensionService::IsBackgroundPageReady(const Extension* extension) { | 2480 bool ExtensionService::IsBackgroundPageReady(const Extension* extension) { |
| 2481 return (extension->background_url().is_empty() || | 2481 return (!extension->has_background_page() || |
| 2482 extension_runtime_data_[extension->id()].background_page_ready); | 2482 extension_runtime_data_[extension->id()].background_page_ready); |
| 2483 } | 2483 } |
| 2484 | 2484 |
| 2485 void ExtensionService::SetBackgroundPageReady(const Extension* extension) { | 2485 void ExtensionService::SetBackgroundPageReady(const Extension* extension) { |
| 2486 DCHECK(!extension->background_url().is_empty()); | 2486 DCHECK(extension->has_background_page()); |
| 2487 extension_runtime_data_[extension->id()].background_page_ready = true; | 2487 extension_runtime_data_[extension->id()].background_page_ready = true; |
| 2488 content::NotificationService::current()->Notify( | 2488 content::NotificationService::current()->Notify( |
| 2489 chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, | 2489 chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, |
| 2490 content::Source<const Extension>(extension), | 2490 content::Source<const Extension>(extension), |
| 2491 content::NotificationService::NoDetails()); | 2491 content::NotificationService::NoDetails()); |
| 2492 } | 2492 } |
| 2493 | 2493 |
| 2494 bool ExtensionService::IsBeingUpgraded(const Extension* extension) { | 2494 bool ExtensionService::IsBeingUpgraded(const Extension* extension) { |
| 2495 return extension_runtime_data_[extension->id()].being_upgraded; | 2495 return extension_runtime_data_[extension->id()].being_upgraded; |
| 2496 } | 2496 } |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2647 // | 2647 // |
| 2648 // To coexist with certain unit tests that don't have an IO thread message | 2648 // To coexist with certain unit tests that don't have an IO thread message |
| 2649 // loop available at ExtensionService shutdown, we lazy-initialize this | 2649 // loop available at ExtensionService shutdown, we lazy-initialize this |
| 2650 // object so that those cases neither create nor destroy a SocketController. | 2650 // object so that those cases neither create nor destroy a SocketController. |
| 2651 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2651 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 2652 if (!socket_controller_) { | 2652 if (!socket_controller_) { |
| 2653 socket_controller_ = new extensions::SocketController(); | 2653 socket_controller_ = new extensions::SocketController(); |
| 2654 } | 2654 } |
| 2655 return socket_controller_; | 2655 return socket_controller_; |
| 2656 } | 2656 } |
| OLD | NEW |