Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 9150008: Introduce background.scripts feature for extension manifests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698