| 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" | |
| 10 #include "chrome/browser/extensions/extension_file_util.h" | 9 #include "chrome/browser/extensions/extension_file_util.h" |
| 11 #include "chrome/browser/extensions/extension_install_ui.h" | 10 #include "chrome/browser/extensions/extension_install_ui.h" |
| 12 #include "chrome/browser/extensions/extensions_service.h" | 11 #include "chrome/browser/extensions/extensions_service.h" |
| 13 #include "chrome/browser/tab_contents/infobar_delegate.h" | 12 #include "chrome/browser/tab_contents/infobar_delegate.h" |
| 14 #include "chrome/browser/tab_contents/tab_contents.h" | 13 #include "chrome/browser/tab_contents/tab_contents.h" |
| 15 #include "chrome/browser/browser_list.h" | 14 #include "chrome/browser/browser_list.h" |
| 16 #include "chrome/common/extensions/extension_resource.h" | 15 #include "chrome/common/extensions/extension_resource.h" |
| 17 #include "chrome/common/notification_registrar.h" | 16 #include "chrome/common/notification_registrar.h" |
| 18 #include "chrome/common/notification_service.h" | 17 #include "chrome/common/notification_service.h" |
| 19 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 48 } | 47 } |
| 49 | 48 |
| 50 private: | 49 private: |
| 51 friend class base::RefCountedThreadSafe<ExtensionDisabledDialogDelegate>; | 50 friend class base::RefCountedThreadSafe<ExtensionDisabledDialogDelegate>; |
| 52 | 51 |
| 53 virtual ~ExtensionDisabledDialogDelegate() {} | 52 virtual ~ExtensionDisabledDialogDelegate() {} |
| 54 | 53 |
| 55 void Start() { | 54 void Start() { |
| 56 // We start on the file thread so we can decode the install icon. | 55 // We start on the file thread so we can decode the install icon. |
| 57 FilePath install_icon_path = install_icon_resource_.GetFilePath(); | 56 FilePath install_icon_path = install_icon_resource_.GetFilePath(); |
| 58 CrxInstaller::DecodeInstallIcon(install_icon_path, &install_icon_); | 57 Extension::DecodeIconFromPath( |
| 58 install_icon_path, Extension::EXTENSION_ICON_LARGE, &install_icon_); |
| 59 // Then we display the UI on the UI thread. | 59 // Then we display the UI on the UI thread. |
| 60 ChromeThread::PostTask( | 60 ChromeThread::PostTask( |
| 61 ChromeThread::UI, FROM_HERE, | 61 ChromeThread::UI, FROM_HERE, |
| 62 NewRunnableMethod( | 62 NewRunnableMethod( |
| 63 this, &ExtensionDisabledDialogDelegate::ConfirmInstall)); | 63 this, &ExtensionDisabledDialogDelegate::ConfirmInstall)); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void ConfirmInstall() { | 66 void ConfirmInstall() { |
| 67 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); | 67 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); |
| 68 ExtensionInstallUI ui(profile_); | 68 ExtensionInstallUI ui(profile_); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 if (!browser) | 147 if (!browser) |
| 148 return; | 148 return; |
| 149 | 149 |
| 150 TabContents* tab_contents = browser->GetSelectedTabContents(); | 150 TabContents* tab_contents = browser->GetSelectedTabContents(); |
| 151 if (!tab_contents) | 151 if (!tab_contents) |
| 152 return; | 152 return; |
| 153 | 153 |
| 154 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( | 154 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( |
| 155 tab_contents, service, extension)); | 155 tab_contents, service, extension)); |
| 156 } | 156 } |
| OLD | NEW |