| 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/ui/extensions/extension_install_ui_default.h" |
| 6 | 6 |
| 7 #include "apps/app_launcher.h" |
| 7 #include "base/bind.h" | 8 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 9 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 11 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| 11 #include "chrome/browser/api/infobars/infobar_service.h" | 12 #include "chrome/browser/api/infobars/infobar_service.h" |
| 12 #include "chrome/browser/extensions/app_launcher.h" | |
| 13 #include "chrome/browser/extensions/extension_install_prompt.h" | 13 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 14 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" | 14 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/themes/theme_service.h" | 16 #include "chrome/browser/themes/theme_service.h" |
| 17 #include "chrome/browser/themes/theme_service_factory.h" | 17 #include "chrome/browser/themes/theme_service_factory.h" |
| 18 #include "chrome/browser/ui/app_list/app_list_util.h" | 18 #include "chrome/browser/ui/app_list/app_list_util.h" |
| 19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 20 #include "chrome/browser/ui/browser_dialogs.h" | 20 #include "chrome/browser/ui/browser_dialogs.h" |
| 21 #include "chrome/browser/ui/browser_finder.h" | 21 #include "chrome/browser/ui/browser_finder.h" |
| 22 #include "chrome/browser/ui/browser_navigator.h" | 22 #include "chrome/browser/ui/browser_navigator.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 if (extension->is_app()) { | 182 if (extension->is_app()) { |
| 183 bool use_bubble = false; | 183 bool use_bubble = false; |
| 184 | 184 |
| 185 #if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX) | 185 #if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX) |
| 186 CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 186 CommandLine* cmdline = CommandLine::ForCurrentProcess(); |
| 187 use_bubble = (use_app_installed_bubble_ || | 187 use_bubble = (use_app_installed_bubble_ || |
| 188 cmdline->HasSwitch(switches::kAppsNewInstallBubble)); | 188 cmdline->HasSwitch(switches::kAppsNewInstallBubble)); |
| 189 #endif | 189 #endif |
| 190 | 190 |
| 191 extensions::UpdateIsAppLauncherEnabled( | 191 apps::GetIsAppLauncherEnabled( |
| 192 base::Bind(&OnAppLauncherEnabledCompleted, extension, browser, icon, | 192 base::Bind(&OnAppLauncherEnabledCompleted, extension, browser, icon, |
| 193 use_bubble)); | 193 use_bubble)); |
| 194 return; | 194 return; |
| 195 } | 195 } |
| 196 | 196 |
| 197 chrome::ShowExtensionInstalledBubble(extension, browser, *icon); | 197 chrome::ShowExtensionInstalledBubble(extension, browser, *icon); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void ExtensionInstallUIDefault::OnInstallFailure( | 200 void ExtensionInstallUIDefault::OnInstallFailure( |
| 201 const extensions::CrxInstallerError& error) { | 201 const extensions::CrxInstallerError& error) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 return new ExtensionInstallPrompt(web_contents); | 262 return new ExtensionInstallPrompt(web_contents); |
| 263 } | 263 } |
| 264 | 264 |
| 265 // static | 265 // static |
| 266 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( | 266 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( |
| 267 Profile* profile) { | 267 Profile* profile) { |
| 268 Browser* browser = chrome::FindLastActiveWithProfile(profile, | 268 Browser* browser = chrome::FindLastActiveWithProfile(profile, |
| 269 chrome::GetActiveDesktop()); | 269 chrome::GetActiveDesktop()); |
| 270 return CreateInstallPromptWithBrowser(browser); | 270 return CreateInstallPromptWithBrowser(browser); |
| 271 } | 271 } |
| OLD | NEW |