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_install_ui_default.h" | 5 #include "chrome/browser/extensions/extension_install_ui_default.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
10 #include "chrome/browser/extensions/extension_install_prompt.h" | 10 #include "chrome/browser/extensions/extension_install_prompt.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 } | 177 } |
178 | 178 |
179 // static | 179 // static |
180 void ExtensionInstallUIDefault::ShowThemeInfoBar( | 180 void ExtensionInstallUIDefault::ShowThemeInfoBar( |
181 const std::string& previous_theme_id, bool previous_using_native_theme, | 181 const std::string& previous_theme_id, bool previous_using_native_theme, |
182 const Extension* new_theme, Profile* profile) { | 182 const Extension* new_theme, Profile* profile) { |
183 if (!new_theme->is_theme()) | 183 if (!new_theme->is_theme()) |
184 return; | 184 return; |
185 | 185 |
186 // Get last active tabbed browser of profile. | 186 // Get last active tabbed browser of profile. |
187 Browser* browser = browser::FindTabbedBrowserDeprecated(profile, true); | 187 Browser* browser = browser::FindTabbedBrowser(profile, |
188 true, | |
189 chrome::GetActiveDesktop()); | |
grt (UTC plus 2)
2012/12/03 15:54:39
if the user clicked on a link on the web store and
robertshield
2012/12/03 20:25:58
Sometimes. This is called from OnInstallSuccess, w
| |
188 if (!browser) | 190 if (!browser) |
189 return; | 191 return; |
190 | 192 |
191 WebContents* web_contents = chrome::GetActiveWebContents(browser); | 193 WebContents* web_contents = chrome::GetActiveWebContents(browser); |
192 if (!web_contents) | 194 if (!web_contents) |
193 return; | 195 return; |
194 InfoBarTabHelper* infobar_helper = | 196 InfoBarTabHelper* infobar_helper = |
195 InfoBarTabHelper::FromWebContents(web_contents); | 197 InfoBarTabHelper::FromWebContents(web_contents); |
196 | 198 |
197 // First find any previous theme preview infobars. | 199 // First find any previous theme preview infobars. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
282 return new ExtensionInstallPrompt(web_contents); | 284 return new ExtensionInstallPrompt(web_contents); |
283 } | 285 } |
284 | 286 |
285 // static | 287 // static |
286 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( | 288 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( |
287 Profile* profile) { | 289 Profile* profile) { |
288 Browser* browser = chrome::FindLastActiveWithProfile(profile, | 290 Browser* browser = chrome::FindLastActiveWithProfile(profile, |
289 chrome::GetActiveDesktop()); | 291 chrome::GetActiveDesktop()); |
290 return CreateInstallPromptWithBrowser(browser); | 292 return CreateInstallPromptWithBrowser(browser); |
291 } | 293 } |
OLD | NEW |