| 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/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "chrome/browser/extensions/extension_system.h" | 30 #include "chrome/browser/extensions/extension_system.h" |
| 31 #include "chrome/browser/extensions/management_policy.h" | 31 #include "chrome/browser/extensions/management_policy.h" |
| 32 #include "chrome/browser/extensions/permissions_updater.h" | 32 #include "chrome/browser/extensions/permissions_updater.h" |
| 33 #include "chrome/browser/extensions/requirements_checker.h" | 33 #include "chrome/browser/extensions/requirements_checker.h" |
| 34 #include "chrome/browser/extensions/webstore_installer.h" | 34 #include "chrome/browser/extensions/webstore_installer.h" |
| 35 #include "chrome/browser/profiles/profile.h" | 35 #include "chrome/browser/profiles/profile.h" |
| 36 #include "chrome/browser/shell_integration.h" | 36 #include "chrome/browser/shell_integration.h" |
| 37 #include "chrome/browser/web_applications/web_app.h" | 37 #include "chrome/browser/web_applications/web_app.h" |
| 38 #include "chrome/common/chrome_notification_types.h" | 38 #include "chrome/common/chrome_notification_types.h" |
| 39 #include "chrome/common/chrome_paths.h" | 39 #include "chrome/common/chrome_paths.h" |
| 40 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 40 #include "chrome/common/extensions/extension_constants.h" | 41 #include "chrome/common/extensions/extension_constants.h" |
| 41 #include "chrome/common/extensions/extension_file_util.h" | 42 #include "chrome/common/extensions/extension_file_util.h" |
| 42 #include "chrome/common/extensions/extension_icon_set.h" | 43 #include "chrome/common/extensions/extension_icon_set.h" |
| 43 #include "chrome/common/extensions/feature_switch.h" | 44 #include "chrome/common/extensions/feature_switch.h" |
| 44 #include "content/public/browser/browser_thread.h" | 45 #include "content/public/browser/browser_thread.h" |
| 45 #include "content/public/browser/notification_service.h" | 46 #include "content/public/browser/notification_service.h" |
| 46 #include "content/public/browser/resource_dispatcher_host.h" | 47 #include "content/public/browser/resource_dispatcher_host.h" |
| 47 #include "content/public/browser/user_metrics.h" | 48 #include "content/public/browser/user_metrics.h" |
| 48 #include "grit/chromium_strings.h" | 49 #include "grit/chromium_strings.h" |
| 49 #include "grit/generated_resources.h" | 50 #include "grit/generated_resources.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 client_(client), | 100 client_(client), |
| 100 apps_require_extension_mime_type_(false), | 101 apps_require_extension_mime_type_(false), |
| 101 allow_silent_install_(false), | 102 allow_silent_install_(false), |
| 102 bypass_blacklist_for_test_(false), | 103 bypass_blacklist_for_test_(false), |
| 103 install_cause_(extension_misc::INSTALL_CAUSE_UNSET), | 104 install_cause_(extension_misc::INSTALL_CAUSE_UNSET), |
| 104 creation_flags_(Extension::NO_FLAGS), | 105 creation_flags_(Extension::NO_FLAGS), |
| 105 off_store_install_allow_reason_(OffStoreInstallDisallowed), | 106 off_store_install_allow_reason_(OffStoreInstallDisallowed), |
| 106 did_handle_successfully_(true), | 107 did_handle_successfully_(true), |
| 107 record_oauth2_grant_(false), | 108 record_oauth2_grant_(false), |
| 108 error_on_unsupported_requirements_(false), | 109 error_on_unsupported_requirements_(false), |
| 109 requirements_checker_(new extensions::RequirementsChecker()), | 110 requirements_checker_(new RequirementsChecker()), |
| 110 has_requirement_errors_(false), | 111 has_requirement_errors_(false), |
| 111 install_wait_for_idle_(true) { | 112 install_wait_for_idle_(true) { |
| 112 installer_task_runner_ = frontend_weak->GetFileTaskRunner(); | 113 installer_task_runner_ = frontend_weak->GetFileTaskRunner(); |
| 113 if (!approval) | 114 if (!approval) |
| 114 return; | 115 return; |
| 115 | 116 |
| 116 CHECK(profile_->IsSameProfile(approval->profile)); | 117 CHECK(profile_->IsSameProfile(approval->profile)); |
| 117 if (client_) { | 118 if (client_) { |
| 118 client_->install_ui()->SetUseAppInstalledBubble( | 119 client_->install_ui()->SetUseAppInstalledBubble( |
| 119 approval->use_app_installed_bubble); | 120 approval->use_app_installed_bubble); |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 // the temp dir. | 379 // the temp dir. |
| 379 unpacked_extension_root_ = extension_dir; | 380 unpacked_extension_root_ = extension_dir; |
| 380 | 381 |
| 381 CrxInstallerError error = AllowInstall(extension); | 382 CrxInstallerError error = AllowInstall(extension); |
| 382 if (error.type() != CrxInstallerError::ERROR_NONE) { | 383 if (error.type() != CrxInstallerError::ERROR_NONE) { |
| 383 ReportFailureFromFileThread(error); | 384 ReportFailureFromFileThread(error); |
| 384 return; | 385 return; |
| 385 } | 386 } |
| 386 | 387 |
| 387 if (client_) { | 388 if (client_) { |
| 388 Extension::DecodeIcon(extension_.get(), | 389 IconsInfo::DecodeIcon(extension_.get(), |
| 389 extension_misc::EXTENSION_ICON_LARGE, | 390 extension_misc::EXTENSION_ICON_LARGE, |
| 390 ExtensionIconSet::MATCH_BIGGER, | 391 ExtensionIconSet::MATCH_BIGGER, |
| 391 &install_icon_); | 392 &install_icon_); |
| 392 } | 393 } |
| 393 | 394 |
| 394 if (!BrowserThread::PostTask( | 395 if (!BrowserThread::PostTask( |
| 395 BrowserThread::UI, FROM_HERE, | 396 BrowserThread::UI, FROM_HERE, |
| 396 base::Bind(&CrxInstaller::CheckRequirements, this))) | 397 base::Bind(&CrxInstaller::CheckRequirements, this))) |
| 397 NOTREACHED(); | 398 NOTREACHED(); |
| 398 } | 399 } |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 temp_dir_ = base::FilePath(); | 696 temp_dir_ = base::FilePath(); |
| 696 } | 697 } |
| 697 | 698 |
| 698 if (delete_source_ && !source_file_.value().empty()) { | 699 if (delete_source_ && !source_file_.value().empty()) { |
| 699 extension_file_util::DeleteFile(source_file_, false); | 700 extension_file_util::DeleteFile(source_file_, false); |
| 700 source_file_ = base::FilePath(); | 701 source_file_ = base::FilePath(); |
| 701 } | 702 } |
| 702 } | 703 } |
| 703 | 704 |
| 704 } // namespace extensions | 705 } // namespace extensions |
| OLD | NEW |