Chromium Code Reviews

Side by Side Diff: chrome/browser/extensions/extension_install_ui.cc

Issue 2659004: Show theme loading info bubble and info bars in last normal browser. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « chrome/browser/download/download_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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.h" 5 #include "chrome/browser/extensions/extension_install_ui.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 287 matching lines...)
298 break; 298 break;
299 } 299 }
300 } 300 }
301 301
302 void ExtensionInstallUI::ShowThemeInfoBar( 302 void ExtensionInstallUI::ShowThemeInfoBar(
303 const std::string& previous_theme_id, bool previous_use_system_theme, 303 const std::string& previous_theme_id, bool previous_use_system_theme,
304 Extension* new_theme, Profile* profile) { 304 Extension* new_theme, Profile* profile) {
305 if (!new_theme->IsTheme()) 305 if (!new_theme->IsTheme())
306 return; 306 return;
307 307
308 Browser* browser = BrowserList::GetLastActiveWithProfile(profile); 308 // Get last active normal browser of profile.
309 Browser* browser = BrowserList::FindBrowserWithType(profile,
310 Browser::TYPE_NORMAL,
311 false);
309 if (!browser) 312 if (!browser)
310 return; 313 return;
311 314
312 TabContents* tab_contents = browser->GetSelectedTabContents(); 315 TabContents* tab_contents = browser->GetSelectedTabContents();
313 if (!tab_contents) 316 if (!tab_contents)
314 return; 317 return;
315 318
316 // First find any previous theme preview infobars. 319 // First find any previous theme preview infobars.
317 InfoBarDelegate* old_delegate = NULL; 320 InfoBarDelegate* old_delegate = NULL;
318 for (int i = 0; i < tab_contents->infobar_delegate_count(); ++i) { 321 for (int i = 0; i < tab_contents->infobar_delegate_count(); ++i) {
(...skipping 58 matching lines...)
377 TabContents* tab_contents, Extension* new_theme, 380 TabContents* tab_contents, Extension* new_theme,
378 const std::string& previous_theme_id, bool previous_use_system_theme) { 381 const std::string& previous_theme_id, bool previous_use_system_theme) {
379 #if defined(TOOLKIT_GTK) 382 #if defined(TOOLKIT_GTK)
380 return new GtkThemeInstalledInfoBarDelegate(tab_contents, new_theme, 383 return new GtkThemeInstalledInfoBarDelegate(tab_contents, new_theme,
381 previous_theme_id, previous_use_system_theme); 384 previous_theme_id, previous_use_system_theme);
382 #else 385 #else
383 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, 386 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme,
384 previous_theme_id); 387 previous_theme_id);
385 #endif 388 #endif
386 } 389 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine