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

Side by Side Diff: chrome/browser/ui/app_list/search/app_result.cc

Issue 725853002: Move app launch metric recording code from NTP to chrome/common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More mac Created 6 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/app_list/extension_app_item.cc ('k') | chrome/browser/ui/browser_commands.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/extension_app_item.cc ('k') | chrome/browser/ui/browser_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698