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/app_list/app_list_controller_delegate.h" | 5 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/extensions/extension_util.h" | 8 #include "chrome/browser/extensions/extension_util.h" |
9 #include "chrome/browser/extensions/install_tracker_factory.h" | 9 #include "chrome/browser/extensions/install_tracker_factory.h" |
10 #include "chrome/browser/extensions/launch_util.h" | 10 #include "chrome/browser/extensions/launch_util.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 12 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
13 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 13 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
14 #include "chrome/browser/ui/app_list/extension_uninstaller.h" | 14 #include "chrome/browser/ui/app_list/extension_uninstaller.h" |
15 #include "chrome/browser/ui/apps/app_info_dialog.h" | 15 #include "chrome/browser/ui/apps/app_info_dialog.h" |
16 #include "chrome/browser/ui/browser_navigator.h" | 16 #include "chrome/browser/ui/browser_navigator.h" |
17 #include "chrome/common/extensions/extension_constants.h" | 17 #include "chrome/common/extensions/extension_constants.h" |
18 #include "chrome/common/extensions/manifest_url_handler.h" | 18 #include "chrome/common/extensions/manifest_url_handler.h" |
| 19 #include "extensions/browser/extension_prefs.h" |
19 #include "extensions/browser/extension_registry.h" | 20 #include "extensions/browser/extension_registry.h" |
20 #include "extensions/browser/extension_system.h" | 21 #include "extensions/browser/extension_system.h" |
21 #include "extensions/browser/management_policy.h" | 22 #include "extensions/browser/management_policy.h" |
22 #include "extensions/common/extension.h" | 23 #include "extensions/common/extension.h" |
23 #include "extensions/common/extension_set.h" | 24 #include "extensions/common/extension_set.h" |
24 #include "net/base/url_util.h" | 25 #include "net/base/url_util.h" |
25 #include "ui/app_list/app_list_folder_item.h" | 26 #include "ui/app_list/app_list_folder_item.h" |
26 #include "ui/app_list/app_list_item.h" | 27 #include "ui/app_list/app_list_item.h" |
27 #include "ui/app_list/app_list_model.h" | 28 #include "ui/app_list/app_list_model.h" |
28 #include "ui/app_list/app_list_switches.h" | 29 #include "ui/app_list/app_list_switches.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 chrome::NavigateParams params( | 176 chrome::NavigateParams params( |
176 profile, | 177 profile, |
177 extensions::ManifestURL::GetOptionsPage(extension), | 178 extensions::ManifestURL::GetOptionsPage(extension), |
178 content::PAGE_TRANSITION_LINK); | 179 content::PAGE_TRANSITION_LINK); |
179 chrome::Navigate(¶ms); | 180 chrome::Navigate(¶ms); |
180 } | 181 } |
181 | 182 |
182 extensions::LaunchType AppListControllerDelegate::GetExtensionLaunchType( | 183 extensions::LaunchType AppListControllerDelegate::GetExtensionLaunchType( |
183 Profile* profile, | 184 Profile* profile, |
184 const std::string& app_id) { | 185 const std::string& app_id) { |
185 ExtensionService* service = | 186 return extensions::GetLaunchType(extensions::ExtensionPrefs::Get(profile), |
186 extensions::ExtensionSystem::Get(profile)->extension_service(); | |
187 return extensions::GetLaunchType(service->extension_prefs(), | |
188 GetExtension(profile, app_id)); | 187 GetExtension(profile, app_id)); |
189 } | 188 } |
190 | 189 |
191 void AppListControllerDelegate::SetExtensionLaunchType( | 190 void AppListControllerDelegate::SetExtensionLaunchType( |
192 Profile* profile, | 191 Profile* profile, |
193 const std::string& extension_id, | 192 const std::string& extension_id, |
194 extensions::LaunchType launch_type) { | 193 extensions::LaunchType launch_type) { |
195 ExtensionService* service = | 194 ExtensionService* service = |
196 extensions::ExtensionSystem::Get(profile)->extension_service(); | 195 extensions::ExtensionSystem::Get(profile)->extension_service(); |
197 extensions::SetLaunchType( | 196 extensions::SetLaunchType( |
(...skipping 13 matching lines...) Expand all Loading... |
211 } | 210 } |
212 | 211 |
213 void AppListControllerDelegate::GetApps(Profile* profile, | 212 void AppListControllerDelegate::GetApps(Profile* profile, |
214 extensions::ExtensionSet* out_apps) { | 213 extensions::ExtensionSet* out_apps) { |
215 ExtensionRegistry* registry = ExtensionRegistry::Get(profile); | 214 ExtensionRegistry* registry = ExtensionRegistry::Get(profile); |
216 DCHECK(registry); | 215 DCHECK(registry); |
217 out_apps->InsertAll(registry->enabled_extensions()); | 216 out_apps->InsertAll(registry->enabled_extensions()); |
218 out_apps->InsertAll(registry->disabled_extensions()); | 217 out_apps->InsertAll(registry->disabled_extensions()); |
219 out_apps->InsertAll(registry->terminated_extensions()); | 218 out_apps->InsertAll(registry->terminated_extensions()); |
220 } | 219 } |
OLD | NEW |