Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Side by Side Diff: chrome/browser/extensions/extension_install_ui_default.cc

Issue 12207104: Refactor app_list_util.h into AppListService abstract base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix some obvious dumbs Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "chrome/browser/api/infobars/infobar_service.h" 11 #include "chrome/browser/api/infobars/infobar_service.h"
12 #include "chrome/browser/extensions/app_launcher.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_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
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 // TODO(tapted): Remove this ifdef.
tapted 2013/02/11 04:04:20 actually, looking at the function name (OnAppLaunc
koz (OOO until 15th September) 2013/02/11 04:33:38 Sounds good to me.
tapted 2013/02/18 07:05:39 Done.
111 #if defined(ENABLE_APP_LIST) 112 #if defined(ENABLE_APP_LIST)
112 if (use_launcher) { 113 if (use_launcher) {
113 chrome::ShowAppList(browser->profile()); 114 AppListService::Get()->ShowAppList(browser->profile());
114 115
115 content::NotificationService::current()->Notify( 116 content::NotificationService::current()->Notify(
116 chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST, 117 chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST,
117 content::Source<Profile>(browser->profile()), 118 content::Source<Profile>(browser->profile()),
118 content::Details<const std::string>(&extension->id())); 119 content::Details<const std::string>(&extension->id()));
119 return; 120 return;
120 } 121 }
121 #endif 122 #endif
122 123
123 if (use_bubble) { 124 if (use_bubble) {
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 return new ExtensionInstallPrompt(web_contents); 263 return new ExtensionInstallPrompt(web_contents);
263 } 264 }
264 265
265 // static 266 // static
266 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( 267 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile(
267 Profile* profile) { 268 Profile* profile) {
268 Browser* browser = chrome::FindLastActiveWithProfile(profile, 269 Browser* browser = chrome::FindLastActiveWithProfile(profile,
269 chrome::GetActiveDesktop()); 270 chrome::GetActiveDesktop());
270 return CreateInstallPromptWithBrowser(browser); 271 return CreateInstallPromptWithBrowser(browser);
271 } 272 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698