| 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/bundle_installer.h" | 5 #include "chrome/browser/extensions/bundle_installer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 for (size_t i = 0; i < dummy_extensions_.size(); ++i) { | 259 for (size_t i = 0; i < dummy_extensions_.size(); ++i) { |
| 260 permissions = ExtensionPermissionSet::CreateUnion( | 260 permissions = ExtensionPermissionSet::CreateUnion( |
| 261 permissions, dummy_extensions_[i]->required_permission_set()); | 261 permissions, dummy_extensions_[i]->required_permission_set()); |
| 262 } | 262 } |
| 263 | 263 |
| 264 if (g_auto_approve_for_test == PROCEED) { | 264 if (g_auto_approve_for_test == PROCEED) { |
| 265 InstallUIProceed(); | 265 InstallUIProceed(); |
| 266 } else if (g_auto_approve_for_test == ABORT) { | 266 } else if (g_auto_approve_for_test == ABORT) { |
| 267 InstallUIAbort(true); | 267 InstallUIAbort(true); |
| 268 } else { | 268 } else { |
| 269 ExtensionInstallUI::Prompt prompt( | 269 install_ui_.reset(new ExtensionInstallUI(profile_)); |
| 270 ExtensionInstallUI::BUNDLE_INSTALL_PROMPT); | 270 install_ui_->ConfirmBundleInstall(this, permissions); |
| 271 prompt.SetPermissions(permissions->GetWarningMessages()); | |
| 272 prompt.set_bundle(this); | |
| 273 | |
| 274 ShowExtensionInstallDialog(profile_, this, prompt); | |
| 275 } | 271 } |
| 276 } | 272 } |
| 277 | 273 |
| 278 void BundleInstaller::ShowInstalledBubbleIfDone() { | 274 void BundleInstaller::ShowInstalledBubbleIfDone() { |
| 279 // We're ready to show the installed bubble when no items are pending. | 275 // We're ready to show the installed bubble when no items are pending. |
| 280 if (!GetItemsWithState(Item::STATE_PENDING).empty()) | 276 if (!GetItemsWithState(Item::STATE_PENDING).empty()) |
| 281 return; | 277 return; |
| 282 | 278 |
| 283 if (browser_) | 279 if (browser_) |
| 284 ShowInstalledBubble(this, browser_); | 280 ShowInstalledBubble(this, browser_); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 336 |
| 341 void BundleInstaller::OnBrowserRemoved(const Browser* browser) { | 337 void BundleInstaller::OnBrowserRemoved(const Browser* browser) { |
| 342 if (browser_ == browser) | 338 if (browser_ == browser) |
| 343 browser_ = NULL; | 339 browser_ = NULL; |
| 344 } | 340 } |
| 345 | 341 |
| 346 void BundleInstaller::OnBrowserSetLastActive(const Browser* browser) { | 342 void BundleInstaller::OnBrowserSetLastActive(const Browser* browser) { |
| 347 } | 343 } |
| 348 | 344 |
| 349 } // namespace extensions | 345 } // namespace extensions |
| OLD | NEW |