| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 10 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 new ErrorInfobarDelegate(infobar_service, browser, error))); | 103 new ErrorInfobarDelegate(infobar_service, browser, error))); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void OnAppLauncherEnabledCompleted(const extensions::Extension* extension, | 106 void OnAppLauncherEnabledCompleted(const extensions::Extension* extension, |
| 107 Browser* browser, | 107 Browser* browser, |
| 108 SkBitmap* icon, | 108 SkBitmap* icon, |
| 109 bool use_bubble, | 109 bool use_bubble, |
| 110 bool use_launcher) { | 110 bool use_launcher) { |
| 111 #if defined(ENABLE_APP_LIST) | 111 #if defined(ENABLE_APP_LIST) |
| 112 if (use_launcher) { | 112 if (use_launcher) { |
| 113 chrome::ShowAppList(); | 113 chrome::ShowAppList(browser->profile()); |
| 114 | 114 |
| 115 content::NotificationService::current()->Notify( | 115 content::NotificationService::current()->Notify( |
| 116 chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST, | 116 chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST, |
| 117 content::Source<Profile>(browser->profile()), | 117 content::Source<Profile>(browser->profile()), |
| 118 content::Details<const std::string>(&extension->id())); | 118 content::Details<const std::string>(&extension->id())); |
| 119 return; | 119 return; |
| 120 } | 120 } |
| 121 #endif | 121 #endif |
| 122 | 122 |
| 123 if (use_bubble) { | 123 if (use_bubble) { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } | 221 } |
| 222 | 222 |
| 223 // static | 223 // static |
| 224 ExtensionInstallUI* ExtensionInstallUI::Create(Profile* profile) { | 224 ExtensionInstallUI* ExtensionInstallUI::Create(Profile* profile) { |
| 225 return new ExtensionInstallUIDefault(profile); | 225 return new ExtensionInstallUIDefault(profile); |
| 226 } | 226 } |
| 227 | 227 |
| 228 // static | 228 // static |
| 229 void ExtensionInstallUI::OpenAppInstalledUI(Browser* browser, | 229 void ExtensionInstallUI::OpenAppInstalledUI(Browser* browser, |
| 230 const std::string& app_id) { | 230 const std::string& app_id) { |
| 231 #if defined(OS_CHROMEOS) | 231 #if defined(ENABLE_APP_LIST) |
| 232 chrome::ShowAppList(); | 232 chrome::ShowAppList(browser->profile()); |
| 233 | 233 |
| 234 content::NotificationService::current()->Notify( | 234 content::NotificationService::current()->Notify( |
| 235 chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST, | 235 chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST, |
| 236 content::Source<Profile>(browser->profile()), | 236 content::Source<Profile>(browser->profile()), |
| 237 content::Details<const std::string>(&app_id)); | 237 content::Details<const std::string>(&app_id)); |
| 238 #else | 238 #else |
| 239 chrome::NavigateParams params(chrome::GetSingletonTabNavigateParams( | 239 chrome::NavigateParams params(chrome::GetSingletonTabNavigateParams( |
| 240 browser, GURL(chrome::kChromeUINewTabURL))); | 240 browser, GURL(chrome::kChromeUINewTabURL))); |
| 241 chrome::Navigate(¶ms); | 241 chrome::Navigate(¶ms); |
| 242 | 242 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 261 return new ExtensionInstallPrompt(web_contents); | 261 return new ExtensionInstallPrompt(web_contents); |
| 262 } | 262 } |
| 263 | 263 |
| 264 // static | 264 // static |
| 265 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( | 265 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( |
| 266 Profile* profile) { | 266 Profile* profile) { |
| 267 Browser* browser = chrome::FindLastActiveWithProfile(profile, | 267 Browser* browser = chrome::FindLastActiveWithProfile(profile, |
| 268 chrome::GetActiveDesktop()); | 268 chrome::GetActiveDesktop()); |
| 269 return CreateInstallPromptWithBrowser(browser); | 269 return CreateInstallPromptWithBrowser(browser); |
| 270 } | 270 } |
| OLD | NEW |