| 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 "chrome/browser/extensions/extension_install_prompt.h" | 10 #include "chrome/browser/extensions/extension_install_prompt.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 scoped_refptr<const Extension> extension_; | 44 scoped_refptr<const Extension> extension_; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 SimpleExtensionLoadPrompt::SimpleExtensionLoadPrompt( | 47 SimpleExtensionLoadPrompt::SimpleExtensionLoadPrompt( |
| 48 Profile* profile, | 48 Profile* profile, |
| 49 base::WeakPtr<ExtensionService> extension_service, | 49 base::WeakPtr<ExtensionService> extension_service, |
| 50 const Extension* extension) | 50 const Extension* extension) |
| 51 : service_weak_(extension_service), | 51 : service_weak_(extension_service), |
| 52 extension_(extension) { | 52 extension_(extension) { |
| 53 Browser* browser = browser::FindLastActiveWithProfile(profile); | 53 Browser* browser = browser::FindLastActiveWithProfile(profile); |
| 54 install_ui_.reset(new ExtensionInstallPrompt(browser)); | 54 install_ui_.reset(chrome::CreateExtensionInstallPromptWithBrowser(browser)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 SimpleExtensionLoadPrompt::~SimpleExtensionLoadPrompt() { | 57 SimpleExtensionLoadPrompt::~SimpleExtensionLoadPrompt() { |
| 58 } | 58 } |
| 59 | 59 |
| 60 void SimpleExtensionLoadPrompt::ShowPrompt() { | 60 void SimpleExtensionLoadPrompt::ShowPrompt() { |
| 61 install_ui_->ConfirmInstall(this, extension_); | 61 install_ui_->ConfirmInstall(this, extension_); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void SimpleExtensionLoadPrompt::InstallUIProceed() { | 64 void SimpleExtensionLoadPrompt::InstallUIProceed() { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 } | 237 } |
| 238 | 238 |
| 239 PermissionsUpdater perms_updater(service_weak_->profile()); | 239 PermissionsUpdater perms_updater(service_weak_->profile()); |
| 240 perms_updater.GrantActivePermissions(extension, false); | 240 perms_updater.GrantActivePermissions(extension, false); |
| 241 service_weak_->OnExtensionInstalled(extension, | 241 service_weak_->OnExtensionInstalled(extension, |
| 242 false, // Not from web store. | 242 false, // Not from web store. |
| 243 StringOrdinal()); | 243 StringOrdinal()); |
| 244 } | 244 } |
| 245 | 245 |
| 246 } // namespace extensions | 246 } // namespace extensions |
| OLD | NEW |