| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 } | 242 } |
| 243 | 243 |
| 244 void ExtensionDisabledGlobalError::BubbleViewAcceptButtonPressed( | 244 void ExtensionDisabledGlobalError::BubbleViewAcceptButtonPressed( |
| 245 Browser* browser) { | 245 Browser* browser) { |
| 246 new ExtensionDisabledDialogDelegate(service_->profile(), service_, | 246 new ExtensionDisabledDialogDelegate(service_->profile(), service_, |
| 247 extension_); | 247 extension_); |
| 248 } | 248 } |
| 249 | 249 |
| 250 void ExtensionDisabledGlobalError::BubbleViewCancelButtonPressed( | 250 void ExtensionDisabledGlobalError::BubbleViewCancelButtonPressed( |
| 251 Browser* browser) { | 251 Browser* browser) { |
| 252 #if !defined(OS_ANDROID) |
| 252 uninstall_dialog_.reset( | 253 uninstall_dialog_.reset( |
| 253 ExtensionUninstallDialog::Create(service_->profile(), this)); | 254 ExtensionUninstallDialog::Create(service_->profile(), this)); |
| 254 // Delay showing the uninstall dialog, so that this function returns | 255 // Delay showing the uninstall dialog, so that this function returns |
| 255 // immediately, to close the bubble properly. See crbug.com/121544. | 256 // immediately, to close the bubble properly. See crbug.com/121544. |
| 256 MessageLoop::current()->PostTask(FROM_HERE, | 257 MessageLoop::current()->PostTask(FROM_HERE, |
| 257 base::Bind(&ExtensionUninstallDialog::ConfirmUninstall, | 258 base::Bind(&ExtensionUninstallDialog::ConfirmUninstall, |
| 258 uninstall_dialog_->AsWeakPtr(), extension_)); | 259 uninstall_dialog_->AsWeakPtr(), extension_)); |
| 260 #endif // !defined(OS_ANDROID) |
| 259 } | 261 } |
| 260 | 262 |
| 261 void ExtensionDisabledGlobalError::ExtensionUninstallAccepted() { | 263 void ExtensionDisabledGlobalError::ExtensionUninstallAccepted() { |
| 262 service_->UninstallExtension(extension_->id(), false, NULL); | 264 service_->UninstallExtension(extension_->id(), false, NULL); |
| 263 } | 265 } |
| 264 | 266 |
| 265 void ExtensionDisabledGlobalError::ExtensionUninstallCanceled() { | 267 void ExtensionDisabledGlobalError::ExtensionUninstallCanceled() { |
| 266 // Nothing happens, and the error is still there. | 268 // Nothing happens, and the error is still there. |
| 267 } | 269 } |
| 268 | 270 |
| (...skipping 34 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 |