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/external_install_ui.h" | 5 #include "chrome/browser/extensions/external_install_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 const Extension* extension = NULL; | 333 const Extension* extension = NULL; |
334 if (service_weak_.get() && | 334 if (service_weak_.get() && |
335 (extension = service_weak_->GetInstalledExtension(extension_id_))) { | 335 (extension = service_weak_->GetInstalledExtension(extension_id_))) { |
336 service_weak_->GrantPermissionsAndEnableExtension(extension); | 336 service_weak_->GrantPermissionsAndEnableExtension(extension); |
337 } | 337 } |
338 Release(); | 338 Release(); |
339 } | 339 } |
340 | 340 |
341 void ExternalInstallDialogDelegate::InstallUIAbort(bool user_initiated) { | 341 void ExternalInstallDialogDelegate::InstallUIAbort(bool user_initiated) { |
342 const Extension* extension = NULL; | 342 const Extension* extension = NULL; |
343 if (service_weak_.get() && | 343 |
| 344 // Uninstall the extension if the abort was user initiated (and not, e.g., the |
| 345 // result of the window closing). |
| 346 // Otherwise, the extension will remain installed, but unacknowledged, so it |
| 347 // will be prompted again. |
| 348 if (user_initiated && |
| 349 service_weak_.get() && |
344 (extension = service_weak_->GetInstalledExtension(extension_id_))) { | 350 (extension = service_weak_->GetInstalledExtension(extension_id_))) { |
345 service_weak_->UninstallExtension(extension_id_, false, NULL); | 351 service_weak_->UninstallExtension(extension_id_, false, NULL); |
346 } | 352 } |
347 Release(); | 353 Release(); |
348 } | 354 } |
349 | 355 |
350 // ExternalInstallMenuAlert ------------------------------------------------- | 356 // ExternalInstallMenuAlert ------------------------------------------------- |
351 | 357 |
352 ExternalInstallMenuAlert::ExternalInstallMenuAlert(ExtensionService* service, | 358 ExternalInstallMenuAlert::ExternalInstallMenuAlert(ExtensionService* service, |
353 const Extension* extension) | 359 const Extension* extension) |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 | 580 |
575 bool HasExternalInstallBubble(ExtensionService* service) { | 581 bool HasExternalInstallBubble(ExtensionService* service) { |
576 GlobalErrorService* error_service = | 582 GlobalErrorService* error_service = |
577 GlobalErrorServiceFactory::GetForProfile(service->profile()); | 583 GlobalErrorServiceFactory::GetForProfile(service->profile()); |
578 GlobalError* error = error_service->GetGlobalErrorByMenuItemCommandID( | 584 GlobalError* error = error_service->GetGlobalErrorByMenuItemCommandID( |
579 kMenuCommandId); | 585 kMenuCommandId); |
580 return error && error->HasBubbleView(); | 586 return error && error->HasBubbleView(); |
581 } | 587 } |
582 | 588 |
583 } // namespace extensions | 589 } // namespace extensions |
OLD | NEW |