| OLD | NEW |
| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 SkBitmap* icon) { | 126 SkBitmap* icon) { |
| 127 extension_ = extension; | 127 extension_ = extension; |
| 128 SetIcon(icon); | 128 SetIcon(icon); |
| 129 | 129 |
| 130 if (extension->is_theme()) { | 130 if (extension->is_theme()) { |
| 131 ShowThemeInfoBar(previous_theme_id_, previous_use_system_theme_, | 131 ShowThemeInfoBar(previous_theme_id_, previous_use_system_theme_, |
| 132 extension, profile_); | 132 extension, profile_); |
| 133 return; | 133 return; |
| 134 } | 134 } |
| 135 | 135 |
| 136 // Note that browser actions don't appear in incognito mode initially, | |
| 137 // so be sure to use a normal browser window. | |
| 138 Profile* profile = profile_; | 136 Profile* profile = profile_; |
| 139 if (extension->browser_action()) | 137 // Browser actions don't appear in incognito mode initially, |
| 138 // so be sure to use a normal browser window. The apps panel (which |
| 139 // has a nice animation for the newly installed app) is not available |
| 140 // in incognito mode (until http://crbug.com/63751 is fixed) so we need a |
| 141 // normal browser window for that too. |
| 142 if (extension->browser_action() || extension->is_app()) |
| 140 profile = profile->GetOriginalProfile(); | 143 profile = profile->GetOriginalProfile(); |
| 141 Browser* browser = Browser::GetOrCreateTabbedBrowser(profile); | 144 Browser* browser = Browser::GetOrCreateTabbedBrowser(profile); |
| 142 if (browser->tab_count() == 0) | 145 if (browser->tab_count() == 0) |
| 143 browser->AddBlankTab(true); | 146 browser->AddBlankTab(true); |
| 144 browser->window()->Show(); | 147 browser->window()->Show(); |
| 145 | 148 |
| 146 if (extension->GetFullLaunchURL().is_valid()) { | 149 if (extension->GetFullLaunchURL().is_valid()) { |
| 147 std::string hash_params = "app-id="; | 150 std::string hash_params = "app-id="; |
| 148 hash_params += extension->id(); | 151 hash_params += extension->id(); |
| 149 | 152 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 TabContents* tab_contents, const Extension* new_theme, | 318 TabContents* tab_contents, const Extension* new_theme, |
| 316 const std::string& previous_theme_id, bool previous_use_system_theme) { | 319 const std::string& previous_theme_id, bool previous_use_system_theme) { |
| 317 #if defined(TOOLKIT_GTK) | 320 #if defined(TOOLKIT_GTK) |
| 318 return new GtkThemeInstalledInfoBarDelegate(tab_contents, new_theme, | 321 return new GtkThemeInstalledInfoBarDelegate(tab_contents, new_theme, |
| 319 previous_theme_id, previous_use_system_theme); | 322 previous_theme_id, previous_use_system_theme); |
| 320 #else | 323 #else |
| 321 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, | 324 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, |
| 322 previous_theme_id); | 325 previous_theme_id); |
| 323 #endif | 326 #endif |
| 324 } | 327 } |
| OLD | NEW |