| 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/extension_file_util.h" | 9 #include "chrome/browser/extensions/extension_file_util.h" |
| 10 #include "chrome/browser/extensions/extension_install_ui.h" | 10 #include "chrome/browser/extensions/extension_install_ui.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 break; | 135 break; |
| 136 } | 136 } |
| 137 default: | 137 default: |
| 138 NOTREACHED(); | 138 NOTREACHED(); |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 | 141 |
| 142 private: | 142 private: |
| 143 NotificationRegistrar registrar_; | 143 NotificationRegistrar registrar_; |
| 144 TabContents* tab_contents_; | 144 TabContents* tab_contents_; |
| 145 ExtensionsService* service_; | 145 scoped_refptr<ExtensionsService> service_; |
| 146 Extension* extension_; | 146 Extension* extension_; |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 void ShowExtensionDisabledUI(ExtensionsService* service, Profile* profile, | 149 void ShowExtensionDisabledUI(ExtensionsService* service, Profile* profile, |
| 150 Extension* extension) { | 150 Extension* extension) { |
| 151 Browser* browser = BrowserList::GetLastActiveWithProfile(profile); | 151 Browser* browser = BrowserList::GetLastActiveWithProfile(profile); |
| 152 if (!browser) | 152 if (!browser) |
| 153 return; | 153 return; |
| 154 | 154 |
| 155 TabContents* tab_contents = browser->GetSelectedTabContents(); | 155 TabContents* tab_contents = browser->GetSelectedTabContents(); |
| 156 if (!tab_contents) | 156 if (!tab_contents) |
| 157 return; | 157 return; |
| 158 | 158 |
| 159 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( | 159 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( |
| 160 tab_contents, service, extension)); | 160 tab_contents, service, extension)); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void ShowExtensionDisabledDialog(ExtensionsService* service, Profile* profile, | 163 void ShowExtensionDisabledDialog(ExtensionsService* service, Profile* profile, |
| 164 Extension* extension) { | 164 Extension* extension) { |
| 165 // This object manages its own lifetime. | 165 // This object manages its own lifetime. |
| 166 new ExtensionDisabledDialogDelegate(profile, service, extension); | 166 new ExtensionDisabledDialogDelegate(profile, service, extension); |
| 167 } | 167 } |
| OLD | NEW |