| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 void ExtensionDisabledGlobalError::BubbleViewAcceptButtonPressed( | 243 void ExtensionDisabledGlobalError::BubbleViewAcceptButtonPressed( |
| 244 Browser* browser) { | 244 Browser* browser) { |
| 245 new ExtensionDisabledDialogDelegate(service_->profile(), service_, | 245 new ExtensionDisabledDialogDelegate(service_->profile(), service_, |
| 246 extension_); | 246 extension_); |
| 247 } | 247 } |
| 248 | 248 |
| 249 void ExtensionDisabledGlobalError::BubbleViewCancelButtonPressed( | 249 void ExtensionDisabledGlobalError::BubbleViewCancelButtonPressed( |
| 250 Browser* browser) { | 250 Browser* browser) { |
| 251 #if !defined(OS_ANDROID) |
| 251 uninstall_dialog_.reset( | 252 uninstall_dialog_.reset( |
| 252 ExtensionUninstallDialog::Create(service_->profile(), this)); | 253 ExtensionUninstallDialog::Create(service_->profile(), this)); |
| 253 // Delay showing the uninstall dialog, so that this function returns | 254 // Delay showing the uninstall dialog, so that this function returns |
| 254 // immediately, to close the bubble properly. See crbug.com/121544. | 255 // immediately, to close the bubble properly. See crbug.com/121544. |
| 255 MessageLoop::current()->PostTask(FROM_HERE, | 256 MessageLoop::current()->PostTask(FROM_HERE, |
| 256 base::Bind(&ExtensionUninstallDialog::ConfirmUninstall, | 257 base::Bind(&ExtensionUninstallDialog::ConfirmUninstall, |
| 257 uninstall_dialog_->AsWeakPtr(), extension_)); | 258 uninstall_dialog_->AsWeakPtr(), extension_)); |
| 259 #endif // !defined(OS_ANDROID) |
| 258 } | 260 } |
| 259 | 261 |
| 260 void ExtensionDisabledGlobalError::ExtensionUninstallAccepted() { | 262 void ExtensionDisabledGlobalError::ExtensionUninstallAccepted() { |
| 261 service_->UninstallExtension(extension_->id(), false, NULL); | 263 service_->UninstallExtension(extension_->id(), false, NULL); |
| 262 } | 264 } |
| 263 | 265 |
| 264 void ExtensionDisabledGlobalError::ExtensionUninstallCanceled() { | 266 void ExtensionDisabledGlobalError::ExtensionUninstallCanceled() { |
| 265 // Nothing happens, and the error is still there. | 267 // Nothing happens, and the error is still there. |
| 266 } | 268 } |
| 267 | 269 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 AddGlobalError(new ExtensionDisabledGlobalError(service, extension)); | 305 AddGlobalError(new ExtensionDisabledGlobalError(service, extension)); |
| 304 } | 306 } |
| 305 | 307 |
| 306 void ShowExtensionDisabledDialog(ExtensionService* service, Profile* profile, | 308 void ShowExtensionDisabledDialog(ExtensionService* service, Profile* profile, |
| 307 const Extension* extension) { | 309 const Extension* extension) { |
| 308 // This object manages its own lifetime. | 310 // This object manages its own lifetime. |
| 309 new ExtensionDisabledDialogDelegate(profile, service, extension); | 311 new ExtensionDisabledDialogDelegate(profile, service, extension); |
| 310 } | 312 } |
| 311 | 313 |
| 312 } // namespace extensions | 314 } // namespace extensions |
| OLD | NEW |