| 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_prefs.h" |
| 20 #include "extensions/browser/extension_registry.h" | 20 #include "extensions/browser/extension_registry.h" |
| 21 #include "extensions/browser/extension_system.h" | 21 #include "extensions/browser/extension_system.h" |
| 22 #include "extensions/browser/management_policy.h" | 22 #include "extensions/browser/management_policy.h" |
| 23 #include "extensions/common/extension.h" | 23 #include "extensions/common/extension.h" |
| 24 #include "extensions/common/extension_set.h" | 24 #include "extensions/common/extension_set.h" |
| 25 #include "extensions/common/manifest_handlers/options_page_info.h" |
| 25 #include "net/base/url_util.h" | 26 #include "net/base/url_util.h" |
| 26 #include "ui/app_list/app_list_folder_item.h" | 27 #include "ui/app_list/app_list_folder_item.h" |
| 27 #include "ui/app_list/app_list_item.h" | 28 #include "ui/app_list/app_list_item.h" |
| 28 #include "ui/app_list/app_list_model.h" | 29 #include "ui/app_list/app_list_model.h" |
| 29 #include "ui/app_list/app_list_switches.h" | 30 #include "ui/app_list/app_list_switches.h" |
| 30 | 31 |
| 31 #if defined(ENABLE_RLZ) | 32 #if defined(ENABLE_RLZ) |
| 32 #include "chrome/browser/rlz/rlz.h" | 33 #include "chrome/browser/rlz/rlz.h" |
| 33 #endif | 34 #endif |
| 34 | 35 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 content::PAGE_TRANSITION_LINK); | 152 content::PAGE_TRANSITION_LINK); |
| 152 chrome::Navigate(¶ms); | 153 chrome::Navigate(¶ms); |
| 153 } | 154 } |
| 154 | 155 |
| 155 bool AppListControllerDelegate::HasOptionsPage( | 156 bool AppListControllerDelegate::HasOptionsPage( |
| 156 Profile* profile, | 157 Profile* profile, |
| 157 const std::string& app_id) { | 158 const std::string& app_id) { |
| 158 const extensions::Extension* extension = GetExtension(profile, app_id); | 159 const extensions::Extension* extension = GetExtension(profile, app_id); |
| 159 return extensions::util::IsAppLaunchableWithoutEnabling(app_id, profile) && | 160 return extensions::util::IsAppLaunchableWithoutEnabling(app_id, profile) && |
| 160 extension && | 161 extension && |
| 161 !extensions::ManifestURL::GetOptionsPage(extension).is_empty(); | 162 !extensions::OptionsPageInfo::GetOptionsPage(extension).is_empty(); |
| 162 } | 163 } |
| 163 | 164 |
| 164 void AppListControllerDelegate::ShowOptionsPage( | 165 void AppListControllerDelegate::ShowOptionsPage( |
| 165 Profile* profile, | 166 Profile* profile, |
| 166 const std::string& app_id) { | 167 const std::string& app_id) { |
| 167 const extensions::Extension* extension = GetExtension(profile, app_id); | 168 const extensions::Extension* extension = GetExtension(profile, app_id); |
| 168 if (!extension) | 169 if (!extension) |
| 169 return; | 170 return; |
| 170 | 171 |
| 171 chrome::NavigateParams params( | 172 chrome::NavigateParams params( |
| 172 profile, | 173 profile, |
| 173 extensions::ManifestURL::GetOptionsPage(extension), | 174 extensions::OptionsPageInfo::GetOptionsPage(extension), |
| 174 content::PAGE_TRANSITION_LINK); | 175 content::PAGE_TRANSITION_LINK); |
| 175 chrome::Navigate(¶ms); | 176 chrome::Navigate(¶ms); |
| 176 } | 177 } |
| 177 | 178 |
| 178 extensions::LaunchType AppListControllerDelegate::GetExtensionLaunchType( | 179 extensions::LaunchType AppListControllerDelegate::GetExtensionLaunchType( |
| 179 Profile* profile, | 180 Profile* profile, |
| 180 const std::string& app_id) { | 181 const std::string& app_id) { |
| 181 return extensions::GetLaunchType(extensions::ExtensionPrefs::Get(profile), | 182 return extensions::GetLaunchType(extensions::ExtensionPrefs::Get(profile), |
| 182 GetExtension(profile, app_id)); | 183 GetExtension(profile, app_id)); |
| 183 } | 184 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 211 out_apps->InsertAll(registry->enabled_extensions()); | 212 out_apps->InsertAll(registry->enabled_extensions()); |
| 212 out_apps->InsertAll(registry->disabled_extensions()); | 213 out_apps->InsertAll(registry->disabled_extensions()); |
| 213 out_apps->InsertAll(registry->terminated_extensions()); | 214 out_apps->InsertAll(registry->terminated_extensions()); |
| 214 } | 215 } |
| 215 | 216 |
| 216 void AppListControllerDelegate::OnSearchStarted() { | 217 void AppListControllerDelegate::OnSearchStarted() { |
| 217 #if defined(ENABLE_RLZ) | 218 #if defined(ENABLE_RLZ) |
| 218 RLZTracker::RecordAppListSearch(); | 219 RLZTracker::RecordAppListSearch(); |
| 219 #endif | 220 #endif |
| 220 } | 221 } |
| OLD | NEW |