| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_system_impl.h" | 5 #include "chrome/browser/extensions/extension_system_impl.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // | 92 // |
| 93 | 93 |
| 94 ExtensionSystemImpl::Shared::Shared(Profile* profile) | 94 ExtensionSystemImpl::Shared::Shared(Profile* profile) |
| 95 : profile_(profile) { | 95 : profile_(profile) { |
| 96 } | 96 } |
| 97 | 97 |
| 98 ExtensionSystemImpl::Shared::~Shared() { | 98 ExtensionSystemImpl::Shared::~Shared() { |
| 99 } | 99 } |
| 100 | 100 |
| 101 void ExtensionSystemImpl::Shared::InitPrefs() { | 101 void ExtensionSystemImpl::Shared::InitPrefs() { |
| 102 lazy_background_task_queue_.reset(new LazyBackgroundTaskQueue(profile_)); | |
| 103 event_router_.reset(new EventRouter(profile_, ExtensionPrefs::Get(profile_))); | 102 event_router_.reset(new EventRouter(profile_, ExtensionPrefs::Get(profile_))); |
| 104 // Two state stores. The latter, which contains declarative rules, must be | 103 // Two state stores. The latter, which contains declarative rules, must be |
| 105 // loaded immediately so that the rules are ready before we issue network | 104 // loaded immediately so that the rules are ready before we issue network |
| 106 // requests. | 105 // requests. |
| 107 state_store_.reset(new StateStore( | 106 state_store_.reset(new StateStore( |
| 108 profile_, | 107 profile_, |
| 109 profile_->GetPath().AppendASCII(extensions::kStateStoreName), | 108 profile_->GetPath().AppendASCII(extensions::kStateStoreName), |
| 110 true)); | 109 true)); |
| 111 state_store_notification_observer_.reset( | 110 state_store_notification_observer_.reset( |
| 112 new StateStoreNotificationObserver(state_store_.get())); | 111 new StateStoreNotificationObserver(state_store_.get())); |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 ExtensionSystemImpl::Shared::shared_user_script_master() { | 423 ExtensionSystemImpl::Shared::shared_user_script_master() { |
| 425 return shared_user_script_master_.get(); | 424 return shared_user_script_master_.get(); |
| 426 } | 425 } |
| 427 | 426 |
| 428 InfoMap* ExtensionSystemImpl::Shared::info_map() { | 427 InfoMap* ExtensionSystemImpl::Shared::info_map() { |
| 429 if (!extension_info_map_.get()) | 428 if (!extension_info_map_.get()) |
| 430 extension_info_map_ = new InfoMap(); | 429 extension_info_map_ = new InfoMap(); |
| 431 return extension_info_map_.get(); | 430 return extension_info_map_.get(); |
| 432 } | 431 } |
| 433 | 432 |
| 434 LazyBackgroundTaskQueue* | |
| 435 ExtensionSystemImpl::Shared::lazy_background_task_queue() { | |
| 436 return lazy_background_task_queue_.get(); | |
| 437 } | |
| 438 | |
| 439 EventRouter* ExtensionSystemImpl::Shared::event_router() { | 433 EventRouter* ExtensionSystemImpl::Shared::event_router() { |
| 440 return event_router_.get(); | 434 return event_router_.get(); |
| 441 } | 435 } |
| 442 | 436 |
| 443 QuotaService* ExtensionSystemImpl::Shared::quota_service() { | 437 QuotaService* ExtensionSystemImpl::Shared::quota_service() { |
| 444 return quota_service_.get(); | 438 return quota_service_.get(); |
| 445 } | 439 } |
| 446 | 440 |
| 447 ContentVerifier* ExtensionSystemImpl::Shared::content_verifier() { | 441 ContentVerifier* ExtensionSystemImpl::Shared::content_verifier() { |
| 448 return content_verifier_.get(); | 442 return content_verifier_.get(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 StateStore* ExtensionSystemImpl::state_store() { | 491 StateStore* ExtensionSystemImpl::state_store() { |
| 498 return shared_->state_store(); | 492 return shared_->state_store(); |
| 499 } | 493 } |
| 500 | 494 |
| 501 StateStore* ExtensionSystemImpl::rules_store() { | 495 StateStore* ExtensionSystemImpl::rules_store() { |
| 502 return shared_->rules_store(); | 496 return shared_->rules_store(); |
| 503 } | 497 } |
| 504 | 498 |
| 505 InfoMap* ExtensionSystemImpl::info_map() { return shared_->info_map(); } | 499 InfoMap* ExtensionSystemImpl::info_map() { return shared_->info_map(); } |
| 506 | 500 |
| 507 LazyBackgroundTaskQueue* ExtensionSystemImpl::lazy_background_task_queue() { | |
| 508 return shared_->lazy_background_task_queue(); | |
| 509 } | |
| 510 | |
| 511 EventRouter* ExtensionSystemImpl::event_router() { | 501 EventRouter* ExtensionSystemImpl::event_router() { |
| 512 return shared_->event_router(); | 502 return shared_->event_router(); |
| 513 } | 503 } |
| 514 | 504 |
| 515 const OneShotEvent& ExtensionSystemImpl::ready() const { | 505 const OneShotEvent& ExtensionSystemImpl::ready() const { |
| 516 return shared_->ready(); | 506 return shared_->ready(); |
| 517 } | 507 } |
| 518 | 508 |
| 519 QuotaService* ExtensionSystemImpl::quota_service() { | 509 QuotaService* ExtensionSystemImpl::quota_service() { |
| 520 return shared_->quota_service(); | 510 return shared_->quota_service(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 551 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
| 562 const std::string& extension_id, | 552 const std::string& extension_id, |
| 563 const UnloadedExtensionInfo::Reason reason) { | 553 const UnloadedExtensionInfo::Reason reason) { |
| 564 BrowserThread::PostTask( | 554 BrowserThread::PostTask( |
| 565 BrowserThread::IO, | 555 BrowserThread::IO, |
| 566 FROM_HERE, | 556 FROM_HERE, |
| 567 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); | 557 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); |
| 568 } | 558 } |
| 569 | 559 |
| 570 } // namespace extensions | 560 } // namespace extensions |
| OLD | NEW |