| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 ShowThemeInfoBar(previous_theme_id_, previous_using_native_theme_, | 126 ShowThemeInfoBar(previous_theme_id_, previous_using_native_theme_, |
| 127 extension, profile_); | 127 extension, profile_); |
| 128 return; | 128 return; |
| 129 } | 129 } |
| 130 | 130 |
| 131 // Extensions aren't enabled by default in incognito so we confirm | 131 // Extensions aren't enabled by default in incognito so we confirm |
| 132 // the install in a normal window. | 132 // the install in a normal window. |
| 133 Profile* current_profile = profile_->GetOriginalProfile(); | 133 Profile* current_profile = profile_->GetOriginalProfile(); |
| 134 Browser* browser = browser::FindOrCreateTabbedBrowser(current_profile); | 134 Browser* browser = browser::FindOrCreateTabbedBrowser(current_profile); |
| 135 if (browser->tab_count() == 0) | 135 if (browser->tab_count() == 0) |
| 136 chrome::AddBlankTab(browser, true); | 136 chrome::AddBlankTabAt(browser, -1, true); |
| 137 browser->window()->Show(); | 137 browser->window()->Show(); |
| 138 | 138 |
| 139 bool use_bubble_for_apps = false; | 139 bool use_bubble_for_apps = false; |
| 140 | 140 |
| 141 #if defined(TOOLKIT_VIEWS) | 141 #if defined(TOOLKIT_VIEWS) |
| 142 CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 142 CommandLine* cmdline = CommandLine::ForCurrentProcess(); |
| 143 use_bubble_for_apps = (use_app_installed_bubble_ || | 143 use_bubble_for_apps = (use_app_installed_bubble_ || |
| 144 cmdline->HasSwitch(switches::kAppsNewInstallBubble)); | 144 cmdline->HasSwitch(switches::kAppsNewInstallBubble)); |
| 145 #endif | 145 #endif |
| 146 | 146 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 web_contents = browser->tab_strip_model()->GetActiveWebContents(); | 281 web_contents = browser->tab_strip_model()->GetActiveWebContents(); |
| 282 return new ExtensionInstallPrompt(web_contents); | 282 return new ExtensionInstallPrompt(web_contents); |
| 283 } | 283 } |
| 284 | 284 |
| 285 // static | 285 // static |
| 286 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( | 286 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( |
| 287 Profile* profile) { | 287 Profile* profile) { |
| 288 Browser* browser = browser::FindLastActiveWithProfile(profile); | 288 Browser* browser = browser::FindLastActiveWithProfile(profile); |
| 289 return CreateInstallPromptWithBrowser(browser); | 289 return CreateInstallPromptWithBrowser(browser); |
| 290 } | 290 } |
| OLD | NEW |