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

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: Changed launch counter to be separated by launch type, and renamed histograms to remove "AppList" 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.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/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"
15 #include "chrome/common/chrome_switches.h" 16 #include "chrome/common/chrome_switches.h"
16 #include "chrome/common/extensions/manifest_url_handler.h" 17 #include "chrome/common/extensions/manifest_url_handler.h"
17 #include "content/public/common/context_menu_params.h" 18 #include "content/public/common/context_menu_params.h"
18 #include "grit/chromium_strings.h" 19 #include "grit/chromium_strings.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 delegate_->ExecuteLaunchCommand(event_flags); 248 delegate_->ExecuteLaunchCommand(event_flags);
248 } else if (command_id == TOGGLE_PIN && controller_->GetPinnable() == 249 } else if (command_id == TOGGLE_PIN && controller_->GetPinnable() ==
249 AppListControllerDelegate::PIN_EDITABLE) { 250 AppListControllerDelegate::PIN_EDITABLE) {
250 if (controller_->IsAppPinned(app_id_)) 251 if (controller_->IsAppPinned(app_id_))
251 controller_->UnpinApp(app_id_); 252 controller_->UnpinApp(app_id_);
252 else 253 else
253 controller_->PinApp(app_id_); 254 controller_->PinApp(app_id_);
254 } else if (command_id == CREATE_SHORTCUTS) { 255 } else if (command_id == CREATE_SHORTCUTS) {
255 controller_->DoCreateShortcutsFlow(profile_, app_id_); 256 controller_->DoCreateShortcutsFlow(profile_, app_id_);
256 } else if (command_id == SHOW_APP_INFO) { 257 } else if (command_id == SHOW_APP_INFO) {
258 UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialogLaunched", 1, 2);
benwells 2014/08/04 01:41:40 Could you define the enum now too?
sashab 2014/08/04 01:47:49 Done :)
257 controller_->DoShowAppInfoFlow(profile_, app_id_); 259 controller_->DoShowAppInfoFlow(profile_, app_id_);
258 } else if (command_id >= USE_LAUNCH_TYPE_COMMAND_START && 260 } else if (command_id >= USE_LAUNCH_TYPE_COMMAND_START &&
259 command_id < USE_LAUNCH_TYPE_COMMAND_END) { 261 command_id < USE_LAUNCH_TYPE_COMMAND_END) {
260 extensions::LaunchType launch_type = static_cast<extensions::LaunchType>( 262 extensions::LaunchType launch_type = static_cast<extensions::LaunchType>(
261 command_id - USE_LAUNCH_TYPE_COMMAND_START); 263 command_id - USE_LAUNCH_TYPE_COMMAND_START);
262 // Streamlined hosted apps can only toggle between LAUNCH_TYPE_WINDOW and 264 // Streamlined hosted apps can only toggle between LAUNCH_TYPE_WINDOW and
263 // LAUNCH_TYPE_REGULAR. 265 // LAUNCH_TYPE_REGULAR.
264 if (CommandLine::ForCurrentProcess()->HasSwitch( 266 if (CommandLine::ForCurrentProcess()->HasSwitch(
265 switches::kEnableStreamlinedHostedApps)) { 267 switches::kEnableStreamlinedHostedApps)) {
266 launch_type = (controller_->GetExtensionLaunchType(profile_, app_id_) == 268 launch_type = (controller_->GetExtensionLaunchType(profile_, app_id_) ==
(...skipping 11 matching lines...) Expand all
278 extension_menu_items_->ExecuteCommand(command_id, NULL, 280 extension_menu_items_->ExecuteCommand(command_id, NULL,
279 content::ContextMenuParams()); 281 content::ContextMenuParams());
280 } else if (command_id == MENU_NEW_WINDOW) { 282 } else if (command_id == MENU_NEW_WINDOW) {
281 controller_->CreateNewWindow(profile_, false); 283 controller_->CreateNewWindow(profile_, false);
282 } else if (command_id == MENU_NEW_INCOGNITO_WINDOW) { 284 } else if (command_id == MENU_NEW_INCOGNITO_WINDOW) {
283 controller_->CreateNewWindow(profile_, true); 285 controller_->CreateNewWindow(profile_, true);
284 } 286 }
285 } 287 }
286 288
287 } // namespace app_list 289 } // namespace app_list
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698