| 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" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 : service_weak_(extension_service), | 54 : service_weak_(extension_service), |
| 55 extension_(extension) { | 55 extension_(extension) { |
| 56 install_ui_.reset( | 56 install_ui_.reset( |
| 57 ExtensionInstallUI::CreateInstallPromptWithProfile(profile)); | 57 ExtensionInstallUI::CreateInstallPromptWithProfile(profile)); |
| 58 } | 58 } |
| 59 | 59 |
| 60 SimpleExtensionLoadPrompt::~SimpleExtensionLoadPrompt() { | 60 SimpleExtensionLoadPrompt::~SimpleExtensionLoadPrompt() { |
| 61 } | 61 } |
| 62 | 62 |
| 63 void SimpleExtensionLoadPrompt::ShowPrompt() { | 63 void SimpleExtensionLoadPrompt::ShowPrompt() { |
| 64 install_ui_->ConfirmInstall(this, extension_); | 64 install_ui_->ConfirmInstall( |
| 65 this, extension_, ExtensionInstallPrompt::GetDefaultShowDialogCallback()); |
| 65 } | 66 } |
| 66 | 67 |
| 67 void SimpleExtensionLoadPrompt::InstallUIProceed() { | 68 void SimpleExtensionLoadPrompt::InstallUIProceed() { |
| 68 if (service_weak_.get()) { | 69 if (service_weak_.get()) { |
| 69 extensions::PermissionsUpdater perms_updater(service_weak_->profile()); | 70 extensions::PermissionsUpdater perms_updater(service_weak_->profile()); |
| 70 perms_updater.GrantActivePermissions(extension_, false); | 71 perms_updater.GrantActivePermissions(extension_, false); |
| 71 service_weak_->OnExtensionInstalled( | 72 service_weak_->OnExtensionInstalled( |
| 72 extension_, | 73 extension_, |
| 73 syncer::StringOrdinal(), | 74 syncer::StringOrdinal(), |
| 74 false /* no requirement errors */); | 75 false /* no requirement errors */); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 } | 260 } |
| 260 | 261 |
| 261 PermissionsUpdater perms_updater(service_weak_->profile()); | 262 PermissionsUpdater perms_updater(service_weak_->profile()); |
| 262 perms_updater.GrantActivePermissions(extension_, false); | 263 perms_updater.GrantActivePermissions(extension_, false); |
| 263 service_weak_->OnExtensionInstalled(extension_, | 264 service_weak_->OnExtensionInstalled(extension_, |
| 264 syncer::StringOrdinal(), | 265 syncer::StringOrdinal(), |
| 265 false /* no requirement errors */); | 266 false /* no requirement errors */); |
| 266 } | 267 } |
| 267 | 268 |
| 268 } // namespace extensions | 269 } // namespace extensions |
| OLD | NEW |