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/ui/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 "apps/app_launcher.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 11 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
12 #include "chrome/browser/api/infobars/infobar_service.h" | 12 #include "chrome/browser/api/infobars/infobar_service.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_service.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" |
23 #include "chrome/browser/ui/browser_tabstrip.h" | 23 #include "chrome/browser/ui/browser_tabstrip.h" |
24 #include "chrome/browser/ui/browser_window.h" | 24 #include "chrome/browser/ui/browser_window.h" |
25 #include "chrome/browser/ui/host_desktop.h" | 25 #include "chrome/browser/ui/host_desktop.h" |
26 #include "chrome/browser/ui/simple_message_box.h" | 26 #include "chrome/browser/ui/simple_message_box.h" |
27 #include "chrome/browser/ui/singleton_tabs.h" | 27 #include "chrome/browser/ui/singleton_tabs.h" |
28 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 28 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 const extensions::CrxInstallerError& error) { | 101 const extensions::CrxInstallerError& error) { |
102 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( | 102 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( |
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) | |
112 if (use_launcher) { | 111 if (use_launcher) { |
113 chrome::ShowAppList(browser->profile()); | 112 AppListService::Get()->ShowAppList(browser->profile()); |
114 | 113 |
115 content::NotificationService::current()->Notify( | 114 content::NotificationService::current()->Notify( |
116 chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST, | 115 chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST, |
117 content::Source<Profile>(browser->profile()), | 116 content::Source<Profile>(browser->profile()), |
118 content::Details<const std::string>(&extension->id())); | 117 content::Details<const std::string>(&extension->id())); |
119 return; | 118 return; |
120 } | 119 } |
121 #endif | |
122 | 120 |
123 if (use_bubble) { | 121 if (use_bubble) { |
124 chrome::ShowExtensionInstalledBubble(extension, browser, *icon); | 122 chrome::ShowExtensionInstalledBubble(extension, browser, *icon); |
125 return; | 123 return; |
126 } | 124 } |
127 | 125 |
128 ExtensionInstallUI::OpenAppInstalledUI(browser, extension->id()); | 126 ExtensionInstallUI::OpenAppInstalledUI(browser, extension->id()); |
129 } | 127 } |
130 | 128 |
131 } // namespace | 129 } // namespace |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
225 | 223 |
226 // static | 224 // static |
227 ExtensionInstallUI* ExtensionInstallUI::Create(Profile* profile) { | 225 ExtensionInstallUI* ExtensionInstallUI::Create(Profile* profile) { |
228 return new ExtensionInstallUIDefault(profile); | 226 return new ExtensionInstallUIDefault(profile); |
229 } | 227 } |
230 | 228 |
231 // static | 229 // static |
232 void ExtensionInstallUI::OpenAppInstalledUI(Browser* browser, | 230 void ExtensionInstallUI::OpenAppInstalledUI(Browser* browser, |
233 const std::string& app_id) { | 231 const std::string& app_id) { |
234 #if defined(OS_CHROMEOS) | 232 #if defined(OS_CHROMEOS) |
235 chrome::ShowAppList(browser->profile()); | 233 chrome::ShowAppList(browser->profile()); |
koz (OOO until 15th September)
2013/02/19 00:08:09
I think you'll need to update this one, too.
tapted
2013/02/19 03:15:32
Done.
| |
236 | 234 |
237 content::NotificationService::current()->Notify( | 235 content::NotificationService::current()->Notify( |
238 chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST, | 236 chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST, |
239 content::Source<Profile>(browser->profile()), | 237 content::Source<Profile>(browser->profile()), |
240 content::Details<const std::string>(&app_id)); | 238 content::Details<const std::string>(&app_id)); |
241 #else | 239 #else |
242 chrome::NavigateParams params(chrome::GetSingletonTabNavigateParams( | 240 chrome::NavigateParams params(chrome::GetSingletonTabNavigateParams( |
243 browser, GURL(chrome::kChromeUINewTabURL))); | 241 browser, GURL(chrome::kChromeUINewTabURL))); |
244 chrome::Navigate(¶ms); | 242 chrome::Navigate(¶ms); |
245 | 243 |
(...skipping 18 matching lines...) Expand all Loading... | |
264 return new ExtensionInstallPrompt(web_contents); | 262 return new ExtensionInstallPrompt(web_contents); |
265 } | 263 } |
266 | 264 |
267 // static | 265 // static |
268 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( | 266 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( |
269 Profile* profile) { | 267 Profile* profile) { |
270 Browser* browser = chrome::FindLastActiveWithProfile(profile, | 268 Browser* browser = chrome::FindLastActiveWithProfile(profile, |
271 chrome::GetActiveDesktop()); | 269 chrome::GetActiveDesktop()); |
272 return CreateInstallPromptWithBrowser(browser); | 270 return CreateInstallPromptWithBrowser(browser); |
273 } | 271 } |
OLD | NEW |