OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/extensions/extension_install_ui.h" | 10 #include "chrome/browser/extensions/extension_install_ui.h" |
11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "chrome/browser/infobars/infobar_tab_helper.h" |
12 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 13 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
13 #include "chrome/browser/ui/browser_list.h" | 14 #include "chrome/browser/ui/browser_list.h" |
14 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
15 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
16 #include "chrome/common/extensions/extension_file_util.h" | 17 #include "chrome/common/extensions/extension_file_util.h" |
17 #include "chrome/common/extensions/extension_resource.h" | 18 #include "chrome/common/extensions/extension_resource.h" |
18 #include "content/browser/tab_contents/tab_contents.h" | 19 #include "content/browser/tab_contents/tab_contents.h" |
19 #include "content/common/notification_details.h" | 20 #include "content/common/notification_details.h" |
20 #include "content/common/notification_registrar.h" | 21 #include "content/common/notification_registrar.h" |
21 #include "content/common/notification_source.h" | 22 #include "content/common/notification_source.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 void ShowExtensionDisabledUI(ExtensionService* service, Profile* profile, | 177 void ShowExtensionDisabledUI(ExtensionService* service, Profile* profile, |
177 const Extension* extension) { | 178 const Extension* extension) { |
178 Browser* browser = BrowserList::GetLastActiveWithProfile(profile); | 179 Browser* browser = BrowserList::GetLastActiveWithProfile(profile); |
179 if (!browser) | 180 if (!browser) |
180 return; | 181 return; |
181 | 182 |
182 TabContentsWrapper* tab_contents = browser->GetSelectedTabContentsWrapper(); | 183 TabContentsWrapper* tab_contents = browser->GetSelectedTabContentsWrapper(); |
183 if (!tab_contents) | 184 if (!tab_contents) |
184 return; | 185 return; |
185 | 186 |
186 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( | 187 tab_contents->infobar_tab_helper()->AddInfoBar( |
187 tab_contents, service, extension)); | 188 new ExtensionDisabledInfobarDelegate(tab_contents, service, extension)); |
188 } | 189 } |
189 | 190 |
190 void ShowExtensionDisabledDialog(ExtensionService* service, Profile* profile, | 191 void ShowExtensionDisabledDialog(ExtensionService* service, Profile* profile, |
191 const Extension* extension) { | 192 const Extension* extension) { |
192 // This object manages its own lifetime. | 193 // This object manages its own lifetime. |
193 new ExtensionDisabledDialogDelegate(profile, service, extension); | 194 new ExtensionDisabledDialogDelegate(profile, service, extension); |
194 } | 195 } |
OLD | NEW |