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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
255 new ExtensionDisabledDialogDelegate(service_, install_ui.Pass(), extension_); | 255 new ExtensionDisabledDialogDelegate(service_, install_ui.Pass(), extension_); |
256 } | 256 } |
257 | 257 |
258 void ExtensionDisabledGlobalError::BubbleViewCancelButtonPressed( | 258 void ExtensionDisabledGlobalError::BubbleViewCancelButtonPressed( |
259 Browser* browser) { | 259 Browser* browser) { |
260 #if !defined(OS_ANDROID) | 260 #if !defined(OS_ANDROID) |
261 uninstall_dialog_.reset( | 261 uninstall_dialog_.reset( |
262 ExtensionUninstallDialog::Create(service_->profile(), browser, this)); | 262 ExtensionUninstallDialog::Create(service_->profile(), browser, this)); |
263 // Delay showing the uninstall dialog, so that this function returns | 263 // Delay showing the uninstall dialog, so that this function returns |
264 // immediately, to close the bubble properly. See crbug.com/121544. | 264 // immediately, to close the bubble properly. See crbug.com/121544. |
265 MessageLoop::current()->PostTask(FROM_HERE, | 265 base::MessageLoop::current()->PostTask( |
266 FROM_HERE, | |
266 base::Bind(&ExtensionUninstallDialog::ConfirmUninstall, | 267 base::Bind(&ExtensionUninstallDialog::ConfirmUninstall, |
267 uninstall_dialog_->AsWeakPtr(), extension_)); | 268 uninstall_dialog_->AsWeakPtr(), |
brettw
2013/04/28 04:26:27
Old way was probably better
| |
269 extension_)); | |
268 #endif // !defined(OS_ANDROID) | 270 #endif // !defined(OS_ANDROID) |
269 } | 271 } |
270 | 272 |
271 void ExtensionDisabledGlobalError::ExtensionUninstallAccepted() { | 273 void ExtensionDisabledGlobalError::ExtensionUninstallAccepted() { |
272 service_->UninstallExtension(extension_->id(), false, NULL); | 274 service_->UninstallExtension(extension_->id(), false, NULL); |
273 } | 275 } |
274 | 276 |
275 void ExtensionDisabledGlobalError::ExtensionUninstallCanceled() { | 277 void ExtensionDisabledGlobalError::ExtensionUninstallCanceled() { |
276 // Nothing happens, and the error is still there. | 278 // Nothing happens, and the error is still there. |
277 } | 279 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
316 void ShowExtensionDisabledDialog(ExtensionService* service, | 318 void ShowExtensionDisabledDialog(ExtensionService* service, |
317 content::WebContents* web_contents, | 319 content::WebContents* web_contents, |
318 const Extension* extension) { | 320 const Extension* extension) { |
319 scoped_ptr<ExtensionInstallPrompt> install_ui( | 321 scoped_ptr<ExtensionInstallPrompt> install_ui( |
320 new ExtensionInstallPrompt(web_contents)); | 322 new ExtensionInstallPrompt(web_contents)); |
321 // This object manages its own lifetime. | 323 // This object manages its own lifetime. |
322 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); | 324 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); |
323 } | 325 } |
324 | 326 |
325 } // namespace extensions | 327 } // namespace extensions |
OLD | NEW |