| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 // static | 224 // static |
| 225 ExtensionInstallUI* ExtensionInstallUI::Create(Profile* profile) { | 225 ExtensionInstallUI* ExtensionInstallUI::Create(Profile* profile) { |
| 226 return new ExtensionInstallUIDefault(profile); | 226 return new ExtensionInstallUIDefault(profile); |
| 227 } | 227 } |
| 228 | 228 |
| 229 // static | 229 // static |
| 230 void ExtensionInstallUI::OpenAppInstalledUI(Browser* browser, | 230 void ExtensionInstallUI::OpenAppInstalledUI(Browser* browser, |
| 231 const std::string& app_id) { | 231 const std::string& app_id) { |
| 232 #if defined(OS_CHROMEOS) | 232 #if defined(OS_CHROMEOS) |
| 233 chrome::ShowAppList(); | 233 chrome::ShowAppList(browser->profile()); |
| 234 | 234 |
| 235 content::NotificationService::current()->Notify( | 235 content::NotificationService::current()->Notify( |
| 236 chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST, | 236 chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST, |
| 237 content::Source<Profile>(browser->profile()), | 237 content::Source<Profile>(browser->profile()), |
| 238 content::Details<const std::string>(&app_id)); | 238 content::Details<const std::string>(&app_id)); |
| 239 #else | 239 #else |
| 240 chrome::NavigateParams params(chrome::GetSingletonTabNavigateParams( | 240 chrome::NavigateParams params(chrome::GetSingletonTabNavigateParams( |
| 241 browser, GURL(chrome::kChromeUINewTabURL))); | 241 browser, GURL(chrome::kChromeUINewTabURL))); |
| 242 chrome::Navigate(¶ms); | 242 chrome::Navigate(¶ms); |
| 243 | 243 |
| (...skipping 18 matching lines...) Expand all 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 |