Chromium Code Reviews| 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/extension_disabled_ui.h" | 5 #include "chrome/browser/extensions/extension_disabled_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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 299 ExtensionUninstallDialog::Create(service_->profile(), browser, this)); | 299 ExtensionUninstallDialog::Create(service_->profile(), browser, this)); |
| 300 // Delay showing the uninstall dialog, so that this function returns | 300 // Delay showing the uninstall dialog, so that this function returns |
| 301 // immediately, to close the bubble properly. See crbug.com/121544. | 301 // immediately, to close the bubble properly. See crbug.com/121544. |
| 302 base::MessageLoop::current()->PostTask(FROM_HERE, | 302 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 303 base::Bind(&ExtensionUninstallDialog::ConfirmUninstall, | 303 base::Bind(&ExtensionUninstallDialog::ConfirmUninstall, |
| 304 uninstall_dialog_->AsWeakPtr(), extension_)); | 304 uninstall_dialog_->AsWeakPtr(), extension_)); |
| 305 #endif // !defined(OS_ANDROID) | 305 #endif // !defined(OS_ANDROID) |
| 306 } | 306 } |
| 307 | 307 |
| 308 void ExtensionDisabledGlobalError::ExtensionUninstallAccepted() { | 308 void ExtensionDisabledGlobalError::ExtensionUninstallAccepted() { |
| 309 service_->UninstallExtension(extension_->id(), false, NULL); | 309 service_->UninstallExtension( |
| 310 extension_->id(), | |
| 311 ExtensionService::kUninstallReasonUserInitiated, | |
|
Devlin
2014/05/14 23:14:20
Looking at this more, maybe we want to differentia
rpaquay
2014/06/30 23:16:18
I created a new enum entry for this case.
| |
| 312 NULL); | |
| 310 } | 313 } |
| 311 | 314 |
| 312 void ExtensionDisabledGlobalError::ExtensionUninstallCanceled() { | 315 void ExtensionDisabledGlobalError::ExtensionUninstallCanceled() { |
| 313 // Nothing happens, and the error is still there. | 316 // Nothing happens, and the error is still there. |
| 314 } | 317 } |
| 315 | 318 |
| 316 void ExtensionDisabledGlobalError::Observe( | 319 void ExtensionDisabledGlobalError::Observe( |
| 317 int type, | 320 int type, |
| 318 const content::NotificationSource& source, | 321 const content::NotificationSource& source, |
| 319 const content::NotificationDetails& details) { | 322 const content::NotificationDetails& details) { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 369 void ShowExtensionDisabledDialog(ExtensionService* service, | 372 void ShowExtensionDisabledDialog(ExtensionService* service, |
| 370 content::WebContents* web_contents, | 373 content::WebContents* web_contents, |
| 371 const Extension* extension) { | 374 const Extension* extension) { |
| 372 scoped_ptr<ExtensionInstallPrompt> install_ui( | 375 scoped_ptr<ExtensionInstallPrompt> install_ui( |
| 373 new ExtensionInstallPrompt(web_contents)); | 376 new ExtensionInstallPrompt(web_contents)); |
| 374 // This object manages its own lifetime. | 377 // This object manages its own lifetime. |
| 375 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); | 378 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); |
| 376 } | 379 } |
| 377 | 380 |
| 378 } // namespace extensions | 381 } // namespace extensions |
| OLD | NEW |