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

Side by Side Diff: chrome/browser/ui/app_list/app_context_menu.cc

Issue 424943002: Add UMA for app info dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed INVALID key Created 6 years, 4 months 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
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/app_context_menu.h" 5 #include "chrome/browser/ui/app_list/app_context_menu.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/metrics/histogram.h"
9 #include "chrome/browser/extensions/context_menu_matcher.h" 10 #include "chrome/browser/extensions/context_menu_matcher.h"
10 #include "chrome/browser/extensions/menu_manager.h" 11 #include "chrome/browser/extensions/menu_manager.h"
11 #include "chrome/browser/prefs/incognito_mode_prefs.h" 12 #include "chrome/browser/prefs/incognito_mode_prefs.h"
12 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/ui/app_list/app_context_menu_delegate.h" 14 #include "chrome/browser/ui/app_list/app_context_menu_delegate.h"
14 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" 15 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
16 #include "chrome/browser/ui/apps/app_info_dialog.h"
15 #include "chrome/common/chrome_switches.h" 17 #include "chrome/common/chrome_switches.h"
16 #include "chrome/common/extensions/manifest_url_handler.h" 18 #include "chrome/common/extensions/manifest_url_handler.h"
17 #include "content/public/common/context_menu_params.h" 19 #include "content/public/common/context_menu_params.h"
18 #include "grit/chromium_strings.h" 20 #include "grit/chromium_strings.h"
19 #include "grit/generated_resources.h" 21 #include "grit/generated_resources.h"
20 #include "ui/base/l10n/l10n_util.h" 22 #include "ui/base/l10n/l10n_util.h"
21 23
22 #if defined(USE_ASH) 24 #if defined(USE_ASH)
23 #include "ash/shell.h" 25 #include "ash/shell.h"
24 #endif 26 #endif
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 delegate_->ExecuteLaunchCommand(event_flags); 249 delegate_->ExecuteLaunchCommand(event_flags);
248 } else if (command_id == TOGGLE_PIN && controller_->GetPinnable() == 250 } else if (command_id == TOGGLE_PIN && controller_->GetPinnable() ==
249 AppListControllerDelegate::PIN_EDITABLE) { 251 AppListControllerDelegate::PIN_EDITABLE) {
250 if (controller_->IsAppPinned(app_id_)) 252 if (controller_->IsAppPinned(app_id_))
251 controller_->UnpinApp(app_id_); 253 controller_->UnpinApp(app_id_);
252 else 254 else
253 controller_->PinApp(app_id_); 255 controller_->PinApp(app_id_);
254 } else if (command_id == CREATE_SHORTCUTS) { 256 } else if (command_id == CREATE_SHORTCUTS) {
255 controller_->DoCreateShortcutsFlow(profile_, app_id_); 257 controller_->DoCreateShortcutsFlow(profile_, app_id_);
256 } else if (command_id == SHOW_APP_INFO) { 258 } else if (command_id == SHOW_APP_INFO) {
259 UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialogLaunched",
260 AppInfoDialogLaunchSource::FROM_APP_LIST,
261 AppInfoDialogLaunchSource::NUM_LAUNCH_SOURCES);
Alexei Svitkine (slow) 2014/08/06 16:46:44 Since you only have one launch source, is this eve
sashab 2014/08/11 01:32:06 Ahh yup; agreed :) Done.
257 controller_->DoShowAppInfoFlow(profile_, app_id_); 262 controller_->DoShowAppInfoFlow(profile_, app_id_);
258 } else if (command_id >= USE_LAUNCH_TYPE_COMMAND_START && 263 } else if (command_id >= USE_LAUNCH_TYPE_COMMAND_START &&
259 command_id < USE_LAUNCH_TYPE_COMMAND_END) { 264 command_id < USE_LAUNCH_TYPE_COMMAND_END) {
260 extensions::LaunchType launch_type = static_cast<extensions::LaunchType>( 265 extensions::LaunchType launch_type = static_cast<extensions::LaunchType>(
261 command_id - USE_LAUNCH_TYPE_COMMAND_START); 266 command_id - USE_LAUNCH_TYPE_COMMAND_START);
262 // Streamlined hosted apps can only toggle between LAUNCH_TYPE_WINDOW and 267 // Streamlined hosted apps can only toggle between LAUNCH_TYPE_WINDOW and
263 // LAUNCH_TYPE_REGULAR. 268 // LAUNCH_TYPE_REGULAR.
264 if (CommandLine::ForCurrentProcess()->HasSwitch( 269 if (CommandLine::ForCurrentProcess()->HasSwitch(
265 switches::kEnableStreamlinedHostedApps)) { 270 switches::kEnableStreamlinedHostedApps)) {
266 launch_type = (controller_->GetExtensionLaunchType(profile_, app_id_) == 271 launch_type = (controller_->GetExtensionLaunchType(profile_, app_id_) ==
(...skipping 11 matching lines...) Expand all
278 extension_menu_items_->ExecuteCommand(command_id, NULL, 283 extension_menu_items_->ExecuteCommand(command_id, NULL,
279 content::ContextMenuParams()); 284 content::ContextMenuParams());
280 } else if (command_id == MENU_NEW_WINDOW) { 285 } else if (command_id == MENU_NEW_WINDOW) {
281 controller_->CreateNewWindow(profile_, false); 286 controller_->CreateNewWindow(profile_, false);
282 } else if (command_id == MENU_NEW_INCOGNITO_WINDOW) { 287 } else if (command_id == MENU_NEW_INCOGNITO_WINDOW) {
283 controller_->CreateNewWindow(profile_, true); 288 controller_->CreateNewWindow(profile_, true);
284 } 289 }
285 } 290 }
286 291
287 } // namespace app_list 292 } // namespace app_list
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/apps/app_info_dialog.h » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698