| 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/unpacked_installer.h" | 5 #include "chrome/browser/extensions/unpacked_installer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/threading/thread_restrictions.h" | 11 #include "base/threading/thread_restrictions.h" |
| 12 #include "chrome/browser/extensions/extension_install_dialog.h" |
| 12 #include "chrome/browser/extensions/extension_install_prompt.h" | 13 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 13 #include "chrome/browser/extensions/extension_install_ui.h" | 14 #include "chrome/browser/extensions/extension_install_ui.h" |
| 14 #include "chrome/browser/extensions/extension_prefs.h" | 15 #include "chrome/browser/extensions/extension_prefs.h" |
| 15 #include "chrome/browser/extensions/extension_service.h" | 16 #include "chrome/browser/extensions/extension_service.h" |
| 16 #include "chrome/browser/extensions/permissions_updater.h" | 17 #include "chrome/browser/extensions/permissions_updater.h" |
| 17 #include "chrome/browser/extensions/requirements_checker.h" | 18 #include "chrome/browser/extensions/requirements_checker.h" |
| 18 #include "chrome/common/extensions/extension.h" | 19 #include "chrome/common/extensions/extension.h" |
| 19 #include "chrome/common/extensions/extension_file_util.h" | 20 #include "chrome/common/extensions/extension_file_util.h" |
| 20 #include "sync/api/string_ordinal.h" | 21 #include "sync/api/string_ordinal.h" |
| 21 | 22 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 : service_weak_(extension_service), | 55 : service_weak_(extension_service), |
| 55 extension_(extension) { | 56 extension_(extension) { |
| 56 install_ui_.reset( | 57 install_ui_.reset( |
| 57 ExtensionInstallUI::CreateInstallPromptWithProfile(profile)); | 58 ExtensionInstallUI::CreateInstallPromptWithProfile(profile)); |
| 58 } | 59 } |
| 59 | 60 |
| 60 SimpleExtensionLoadPrompt::~SimpleExtensionLoadPrompt() { | 61 SimpleExtensionLoadPrompt::~SimpleExtensionLoadPrompt() { |
| 61 } | 62 } |
| 62 | 63 |
| 63 void SimpleExtensionLoadPrompt::ShowPrompt() { | 64 void SimpleExtensionLoadPrompt::ShowPrompt() { |
| 64 install_ui_->ConfirmInstall(this, extension_); | 65 install_ui_->ConfirmInstall( |
| 66 this, extension_, ExtensionInstallDialog::CreateDefaultImpl()); |
| 65 } | 67 } |
| 66 | 68 |
| 67 void SimpleExtensionLoadPrompt::InstallUIProceed() { | 69 void SimpleExtensionLoadPrompt::InstallUIProceed() { |
| 68 if (service_weak_.get()) { | 70 if (service_weak_.get()) { |
| 69 extensions::PermissionsUpdater perms_updater(service_weak_->profile()); | 71 extensions::PermissionsUpdater perms_updater(service_weak_->profile()); |
| 70 perms_updater.GrantActivePermissions(extension_, false); | 72 perms_updater.GrantActivePermissions(extension_, false); |
| 71 service_weak_->OnExtensionInstalled( | 73 service_weak_->OnExtensionInstalled( |
| 72 extension_, | 74 extension_, |
| 73 syncer::StringOrdinal(), | 75 syncer::StringOrdinal(), |
| 74 false /* no requirement errors */); | 76 false /* no requirement errors */); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 } | 261 } |
| 260 | 262 |
| 261 PermissionsUpdater perms_updater(service_weak_->profile()); | 263 PermissionsUpdater perms_updater(service_weak_->profile()); |
| 262 perms_updater.GrantActivePermissions(extension_, false); | 264 perms_updater.GrantActivePermissions(extension_, false); |
| 263 service_weak_->OnExtensionInstalled(extension_, | 265 service_weak_->OnExtensionInstalled(extension_, |
| 264 syncer::StringOrdinal(), | 266 syncer::StringOrdinal(), |
| 265 false /* no requirement errors */); | 267 false /* no requirement errors */); |
| 266 } | 268 } |
| 267 | 269 |
| 268 } // namespace extensions | 270 } // namespace extensions |
| OLD | NEW |