OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/search/app_result.h" | 5 #include "chrome/browser/ui/app_list/search/app_result.h" |
6 | 6 |
7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_util.h" | 9 #include "chrome/browser/extensions/extension_util.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/app_list/app_context_menu.h" | 11 #include "chrome/browser/ui/app_list/app_context_menu.h" |
12 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 12 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
13 #include "chrome/browser/ui/app_list/search/search_util.h" | 13 #include "chrome/browser/ui/app_list/search/search_util.h" |
14 #include "chrome/browser/ui/extensions/extension_enable_flow.h" | 14 #include "chrome/browser/ui/extensions/extension_enable_flow.h" |
15 #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h" | 15 #include "chrome/common/extensions/extension_metrics.h" |
16 #include "content/public/browser/user_metrics.h" | 16 #include "content/public/browser/user_metrics.h" |
17 #include "extensions/browser/extension_registry.h" | 17 #include "extensions/browser/extension_registry.h" |
18 #include "extensions/browser/extension_system.h" | 18 #include "extensions/browser/extension_system.h" |
19 #include "extensions/browser/extension_system_provider.h" | 19 #include "extensions/browser/extension_system_provider.h" |
20 #include "extensions/browser/extensions_browser_client.h" | 20 #include "extensions/browser/extensions_browser_client.h" |
21 #include "extensions/common/constants.h" | 21 #include "extensions/common/constants.h" |
22 #include "extensions/common/extension.h" | 22 #include "extensions/common/extension.h" |
23 #include "extensions/common/extension_icon_set.h" | 23 #include "extensions/common/extension_icon_set.h" |
24 #include "extensions/common/manifest_handlers/icons_handler.h" | 24 #include "extensions/common/manifest_handlers/icons_handler.h" |
25 #include "ui/app_list/app_list_switches.h" | 25 #include "ui/app_list/app_list_switches.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 return; | 98 return; |
99 | 99 |
100 // Don't auto-enable apps that cannot be launched. | 100 // Don't auto-enable apps that cannot be launched. |
101 if (!extensions::util::IsAppLaunchable(app_id_, profile_)) | 101 if (!extensions::util::IsAppLaunchable(app_id_, profile_)) |
102 return; | 102 return; |
103 | 103 |
104 // Check if enable flow is already running or should be started | 104 // Check if enable flow is already running or should be started |
105 if (RunExtensionEnableFlow()) | 105 if (RunExtensionEnableFlow()) |
106 return; | 106 return; |
107 | 107 |
108 CoreAppLauncherHandler::RecordAppListSearchLaunch(extension); | 108 extensions::RecordAppListSearchLaunch(extension); |
109 content::RecordAction( | 109 content::RecordAction( |
110 base::UserMetricsAction("AppList_ClickOnAppFromSearch")); | 110 base::UserMetricsAction("AppList_ClickOnAppFromSearch")); |
111 | 111 |
112 controller_->ActivateApp( | 112 controller_->ActivateApp( |
113 profile_, | 113 profile_, |
114 extension, | 114 extension, |
115 AppListControllerDelegate::LAUNCH_FROM_APP_LIST_SEARCH, | 115 AppListControllerDelegate::LAUNCH_FROM_APP_LIST_SEARCH, |
116 event_flags); | 116 event_flags); |
117 } | 117 } |
118 | 118 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 NotifyItemUninstalled(); | 210 NotifyItemUninstalled(); |
211 } | 211 } |
212 | 212 |
213 void AppResult::OnShutdown(extensions::ExtensionRegistry* registry) { | 213 void AppResult::OnShutdown(extensions::ExtensionRegistry* registry) { |
214 DCHECK_EQ(extension_registry_, registry); | 214 DCHECK_EQ(extension_registry_, registry); |
215 StopObservingExtensionRegistry(); | 215 StopObservingExtensionRegistry(); |
216 } | 216 } |
217 | 217 |
218 } // namespace app_list | 218 } // namespace app_list |
OLD | NEW |