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

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

Issue 10031002: Allow extension APIs to be compiled out. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unneeded resources Created 8 years, 8 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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 // Idempotent, so although there is a possible race if the import 523 // Idempotent, so although there is a possible race if the import
524 // process finished sometime in the middle of ProfileImpl::InitExtensions, 524 // process finished sometime in the middle of ProfileImpl::InitExtensions,
525 // it cannot happen twice. 525 // it cannot happen twice.
526 InitEventRouters(); 526 InitEventRouters();
527 } 527 }
528 528
529 void ExtensionService::InitEventRouters() { 529 void ExtensionService::InitEventRouters() {
530 if (event_routers_initialized_) 530 if (event_routers_initialized_)
531 return; 531 return;
532 532
533 #if defined(ENABLE_EXTENSIONS)
533 downloads_event_router_.reset(new ExtensionDownloadsEventRouter(profile_)); 534 downloads_event_router_.reset(new ExtensionDownloadsEventRouter(profile_));
534 history_event_router_.reset(new HistoryExtensionEventRouter()); 535 history_event_router_.reset(new HistoryExtensionEventRouter());
535 history_event_router_->ObserveProfile(profile_); 536 history_event_router_->ObserveProfile(profile_);
536 browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_)); 537 browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_));
537 browser_event_router_->Init(); 538 browser_event_router_->Init();
538 preference_event_router_.reset(new ExtensionPreferenceEventRouter(profile_)); 539 preference_event_router_.reset(new ExtensionPreferenceEventRouter(profile_));
539 bookmark_event_router_.reset(new BookmarkExtensionEventRouter( 540 bookmark_event_router_.reset(new BookmarkExtensionEventRouter(
540 profile_->GetBookmarkModel())); 541 profile_->GetBookmarkModel()));
541 bookmark_event_router_->Init(); 542 bookmark_event_router_->Init();
542 cookies_event_router_.reset(new ExtensionCookiesEventRouter(profile_)); 543 cookies_event_router_.reset(new ExtensionCookiesEventRouter(profile_));
(...skipping 16 matching lines...) Expand all
559 new chromeos::ExtensionInputMethodEventRouter); 560 new chromeos::ExtensionInputMethodEventRouter);
560 561
561 ExtensionMediaPlayerEventRouter::GetInstance()->Init(profile_); 562 ExtensionMediaPlayerEventRouter::GetInstance()->Init(profile_);
562 ExtensionInputImeEventRouter::GetInstance()->Init(); 563 ExtensionInputImeEventRouter::GetInstance()->Init();
563 #endif 564 #endif
564 565
565 #if defined(OS_CHROMEOS) && defined(USE_VIRTUAL_KEYBOARD) 566 #if defined(OS_CHROMEOS) && defined(USE_VIRTUAL_KEYBOARD)
566 ExtensionInputUiEventRouter::GetInstance()->Init(); 567 ExtensionInputUiEventRouter::GetInstance()->Init();
567 #endif 568 #endif
568 569
570 #endif // defined(ENABLE_EXTENSIONS)
569 event_routers_initialized_ = true; 571 event_routers_initialized_ = true;
570 } 572 }
571 573
572 const Extension* ExtensionService::GetExtensionById( 574 const Extension* ExtensionService::GetExtensionById(
573 const std::string& id, bool include_disabled) const { 575 const std::string& id, bool include_disabled) const {
574 return GetExtensionByIdInternal(id, true, include_disabled, false); 576 return GetExtensionByIdInternal(id, true, include_disabled, false);
575 } 577 }
576 578
577 void ExtensionService::Init() { 579 void ExtensionService::Init() {
578 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 580 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after
2639 // To coexist with certain unit tests that don't have an IO thread message 2641 // To coexist with certain unit tests that don't have an IO thread message
2640 // loop available at ExtensionService shutdown, we lazy-initialize this 2642 // loop available at ExtensionService shutdown, we lazy-initialize this
2641 // object so that those cases neither create nor destroy an 2643 // object so that those cases neither create nor destroy an
2642 // APIResourceController. 2644 // APIResourceController.
2643 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 2645 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
2644 if (!api_resource_controller_) { 2646 if (!api_resource_controller_) {
2645 api_resource_controller_ = new extensions::APIResourceController(); 2647 api_resource_controller_ = new extensions::APIResourceController();
2646 } 2648 }
2647 return api_resource_controller_; 2649 return api_resource_controller_;
2648 } 2650 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698