| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_infobar_delegate.h" | 5 #include "chrome/browser/extensions/extension_disabled_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "chrome/browser/chrome_thread.h" | 8 #include "chrome/browser/chrome_thread.h" |
| 9 #include "chrome/browser/extensions/crx_installer.h" | 9 #include "chrome/browser/extensions/crx_installer.h" |
| 10 #include "chrome/browser/extensions/extension_file_util.h" | 10 #include "chrome/browser/extensions/extension_file_util.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 ExtensionsService* service, | 26 ExtensionsService* service, |
| 27 Extension* extension) | 27 Extension* extension) |
| 28 : profile_(profile), service_(service), extension_(extension), | 28 : profile_(profile), service_(service), extension_(extension), |
| 29 ui_loop_(MessageLoop::current()) { | 29 ui_loop_(MessageLoop::current()) { |
| 30 AddRef(); // balanced in ContinueInstall or AbortInstall. | 30 AddRef(); // balanced in ContinueInstall or AbortInstall. |
| 31 | 31 |
| 32 // Do this now because we can't touch extension on the file loop. | 32 // Do this now because we can't touch extension on the file loop. |
| 33 install_icon_resource_ = | 33 install_icon_resource_ = |
| 34 extension_->GetIconPath(Extension::EXTENSION_ICON_LARGE); | 34 extension_->GetIconPath(Extension::EXTENSION_ICON_LARGE); |
| 35 | 35 |
| 36 ChromeThread::GetMessageLoop(ChromeThread::FILE)->PostTask(FROM_HERE, | 36 ChromeThread::PostTask( |
| 37 ChromeThread::FILE, FROM_HERE, |
| 37 NewRunnableMethod(this, &ExtensionDisabledDialogDelegate::Start)); | 38 NewRunnableMethod(this, &ExtensionDisabledDialogDelegate::Start)); |
| 38 } | 39 } |
| 39 | 40 |
| 40 virtual ~ExtensionDisabledDialogDelegate() { | 41 virtual ~ExtensionDisabledDialogDelegate() { |
| 41 } | 42 } |
| 42 | 43 |
| 43 // ExtensionInstallUI::Delegate | 44 // ExtensionInstallUI::Delegate |
| 44 virtual void ContinueInstall() { | 45 virtual void ContinueInstall() { |
| 45 service_->EnableExtension(extension_->id()); | 46 service_->EnableExtension(extension_->id()); |
| 46 Release(); | 47 Release(); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 if (!browser) | 147 if (!browser) |
| 147 return; | 148 return; |
| 148 | 149 |
| 149 TabContents* tab_contents = browser->GetSelectedTabContents(); | 150 TabContents* tab_contents = browser->GetSelectedTabContents(); |
| 150 if (!tab_contents) | 151 if (!tab_contents) |
| 151 return; | 152 return; |
| 152 | 153 |
| 153 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( | 154 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( |
| 154 tab_contents, service, extension)); | 155 tab_contents, service, extension)); |
| 155 } | 156 } |
| OLD | NEW |