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/extension_app_item.h" | 5 #include "chrome/browser/ui/app_list/extension_app_item.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/extensions/extension_prefs.h" | 8 #include "chrome/browser/extensions/extension_prefs.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_sorting.h" | 10 #include "chrome/browser/extensions/extension_sorting.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 void ExtensionAppItem::Activate(int event_flags) { | 252 void ExtensionAppItem::Activate(int event_flags) { |
253 // |extension| could be NULL when it is being unloaded for updating. | 253 // |extension| could be NULL when it is being unloaded for updating. |
254 const Extension* extension = GetExtension(); | 254 const Extension* extension = GetExtension(); |
255 if (!extension) | 255 if (!extension) |
256 return; | 256 return; |
257 | 257 |
258 if (RunExtensionEnableFlow()) | 258 if (RunExtensionEnableFlow()) |
259 return; | 259 return; |
260 | 260 |
261 AppLauncherHandler::RecordAppLaunchType( | 261 AppLauncherHandler::RecordAppListMainLaunch(extension); |
262 extension_misc::APP_LAUNCH_APP_LIST_MAIN, | |
263 extension->GetType()); | |
264 controller_->ActivateApp(profile_, extension, event_flags); | 262 controller_->ActivateApp(profile_, extension, event_flags); |
265 } | 263 } |
266 | 264 |
267 ui::MenuModel* ExtensionAppItem::GetContextMenuModel() { | 265 ui::MenuModel* ExtensionAppItem::GetContextMenuModel() { |
268 if (!context_menu_) { | 266 if (!context_menu_) { |
269 context_menu_.reset(new app_list::AppContextMenu( | 267 context_menu_.reset(new app_list::AppContextMenu( |
270 this, profile_, extension_id_, controller_, is_platform_app_)); | 268 this, profile_, extension_id_, controller_, is_platform_app_)); |
271 } | 269 } |
272 | 270 |
273 return context_menu_->GetMenuModel(); | 271 return context_menu_->GetMenuModel(); |
274 } | 272 } |
275 | 273 |
276 void ExtensionAppItem::ExecuteLaunchCommand(int event_flags) { | 274 void ExtensionAppItem::ExecuteLaunchCommand(int event_flags) { |
277 Launch(event_flags); | 275 Launch(event_flags); |
278 } | 276 } |
OLD | NEW |