| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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() { |
| 65 if (service_weak_.get()) { | 65 if (service_weak_.get()) { |
| 66 extensions::PermissionsUpdater perms_updater(service_weak_->profile()); | 66 extensions::PermissionsUpdater perms_updater(service_weak_->profile()); |
| 67 perms_updater.GrantActivePermissions(extension_); | 67 perms_updater.GrantActivePermissions(extension_, false); |
| 68 service_weak_->OnExtensionInstalled( | 68 service_weak_->OnExtensionInstalled( |
| 69 extension_, false, StringOrdinal()); // Not from web store. | 69 extension_, false, StringOrdinal()); // Not from web store. |
| 70 } | 70 } |
| 71 delete this; | 71 delete this; |
| 72 } | 72 } |
| 73 | 73 |
| 74 void SimpleExtensionLoadPrompt::InstallUIAbort(bool user_initiated) { | 74 void SimpleExtensionLoadPrompt::InstallUIAbort(bool user_initiated) { |
| 75 delete this; | 75 delete this; |
| 76 } | 76 } |
| 77 | 77 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 !disabled_extensions->Contains(extension->id())) { | 230 !disabled_extensions->Contains(extension->id())) { |
| 231 SimpleExtensionLoadPrompt* prompt = new SimpleExtensionLoadPrompt( | 231 SimpleExtensionLoadPrompt* prompt = new SimpleExtensionLoadPrompt( |
| 232 service_weak_->profile(), | 232 service_weak_->profile(), |
| 233 service_weak_, | 233 service_weak_, |
| 234 extension); | 234 extension); |
| 235 prompt->ShowPrompt(); | 235 prompt->ShowPrompt(); |
| 236 return; // continues in SimpleExtensionLoadPrompt::InstallPrompt* | 236 return; // continues in SimpleExtensionLoadPrompt::InstallPrompt* |
| 237 } | 237 } |
| 238 | 238 |
| 239 PermissionsUpdater perms_updater(service_weak_->profile()); | 239 PermissionsUpdater perms_updater(service_weak_->profile()); |
| 240 perms_updater.GrantActivePermissions(extension); | 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 |