| 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/webstore_installer.h" | 5 #include "chrome/browser/extensions/webstore_installer.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/browser/extensions/install_tracker.h" | 28 #include "chrome/browser/extensions/install_tracker.h" |
| 29 #include "chrome/browser/extensions/install_tracker_factory.h" | 29 #include "chrome/browser/extensions/install_tracker_factory.h" |
| 30 #include "chrome/browser/extensions/install_verifier.h" | 30 #include "chrome/browser/extensions/install_verifier.h" |
| 31 #include "chrome/browser/extensions/shared_module_service.h" | 31 #include "chrome/browser/extensions/shared_module_service.h" |
| 32 #include "chrome/browser/profiles/profile.h" | 32 #include "chrome/browser/profiles/profile.h" |
| 33 #include "chrome/browser/ui/browser_list.h" | 33 #include "chrome/browser/ui/browser_list.h" |
| 34 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 34 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 35 #include "chrome/common/chrome_paths.h" | 35 #include "chrome/common/chrome_paths.h" |
| 36 #include "chrome/common/chrome_switches.h" | 36 #include "chrome/common/chrome_switches.h" |
| 37 #include "chrome/common/extensions/extension_constants.h" | 37 #include "chrome/common/extensions/extension_constants.h" |
| 38 #include "components/crx_file/id_util.h" |
| 38 #include "components/omaha_query_params/omaha_query_params.h" | 39 #include "components/omaha_query_params/omaha_query_params.h" |
| 39 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
| 40 #include "content/public/browser/download_manager.h" | 41 #include "content/public/browser/download_manager.h" |
| 41 #include "content/public/browser/download_save_info.h" | 42 #include "content/public/browser/download_save_info.h" |
| 42 #include "content/public/browser/download_url_parameters.h" | 43 #include "content/public/browser/download_url_parameters.h" |
| 43 #include "content/public/browser/navigation_controller.h" | 44 #include "content/public/browser/navigation_controller.h" |
| 44 #include "content/public/browser/navigation_entry.h" | 45 #include "content/public/browser/navigation_entry.h" |
| 45 #include "content/public/browser/notification_details.h" | 46 #include "content/public/browser/notification_details.h" |
| 46 #include "content/public/browser/notification_service.h" | 47 #include "content/public/browser/notification_service.h" |
| 47 #include "content/public/browser/notification_source.h" | 48 #include "content/public/browser/notification_source.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 registrar_.Add(this, | 294 registrar_.Add(this, |
| 294 extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR, | 295 extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR, |
| 295 content::Source<CrxInstaller>(NULL)); | 296 content::Source<CrxInstaller>(NULL)); |
| 296 extension_registry_observer_.Add(ExtensionRegistry::Get(profile)); | 297 extension_registry_observer_.Add(ExtensionRegistry::Get(profile)); |
| 297 } | 298 } |
| 298 | 299 |
| 299 void WebstoreInstaller::Start() { | 300 void WebstoreInstaller::Start() { |
| 300 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 301 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 301 AddRef(); // Balanced in ReportSuccess and ReportFailure. | 302 AddRef(); // Balanced in ReportSuccess and ReportFailure. |
| 302 | 303 |
| 303 if (!Extension::IdIsValid(id_)) { | 304 if (!crx_file::id_util::IdIsValid(id_)) { |
| 304 ReportFailure(kInvalidIdError, FAILURE_REASON_OTHER); | 305 ReportFailure(kInvalidIdError, FAILURE_REASON_OTHER); |
| 305 return; | 306 return; |
| 306 } | 307 } |
| 307 | 308 |
| 308 ExtensionService* extension_service = | 309 ExtensionService* extension_service = |
| 309 ExtensionSystem::Get(profile_)->extension_service(); | 310 ExtensionSystem::Get(profile_)->extension_service(); |
| 310 if (approval_.get() && approval_->dummy_extension) { | 311 if (approval_.get() && approval_->dummy_extension) { |
| 311 SharedModuleService::ImportStatus status = | 312 SharedModuleService::ImportStatus status = |
| 312 extension_service->shared_module_service()->CheckImports( | 313 extension_service->shared_module_service()->CheckImports( |
| 313 approval_->dummy_extension, | 314 approval_->dummy_extension, |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 1, | 745 1, |
| 745 kMaxSizeKb, | 746 kMaxSizeKb, |
| 746 kNumBuckets); | 747 kNumBuckets); |
| 747 } | 748 } |
| 748 UMA_HISTOGRAM_BOOLEAN( | 749 UMA_HISTOGRAM_BOOLEAN( |
| 749 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown", | 750 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown", |
| 750 total_bytes <= 0); | 751 total_bytes <= 0); |
| 751 } | 752 } |
| 752 | 753 |
| 753 } // namespace extensions | 754 } // namespace extensions |
| OLD | NEW |