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