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

Side by Side Diff: chrome/browser/ui/ash/launcher/launcher_context_menu.cc

Issue 2946543002: Cros Tablet: Add UMA stats for the user close actions in tablet mode. (Closed)
Patch Set: Address asvitkine@'s comments. Created 3 years, 6 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 | « ash/wm/overview/window_selector_item.cc ('k') | tools/metrics/actions/actions.xml » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/ash/launcher/launcher_context_menu.h" 5 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ash/public/cpp/shelf_model.h" 9 #include "ash/public/cpp/shelf_model.h"
10 #include "ash/shelf/shelf.h" 10 #include "ash/shelf/shelf.h"
11 #include "ash/shelf/shelf_widget.h" 11 #include "ash/shelf/shelf_widget.h"
12 #include "ash/shell.h" 12 #include "ash/shell.h"
13 #include "ash/shell_port.h" 13 #include "ash/shell_port.h"
14 #include "ash/strings/grit/ash_strings.h" 14 #include "ash/strings/grit/ash_strings.h"
15 #include "ash/wallpaper/wallpaper_delegate.h" 15 #include "ash/wallpaper/wallpaper_delegate.h"
16 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
16 #include "build/build_config.h" 17 #include "build/build_config.h"
17 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" 18 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
18 #include "chrome/browser/fullscreen.h" 19 #include "chrome/browser/fullscreen.h"
19 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" 21 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
21 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" 22 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
22 #include "chrome/browser/ui/ash/launcher/arc_launcher_context_menu.h" 23 #include "chrome/browser/ui/ash/launcher/arc_launcher_context_menu.h"
23 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 24 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
24 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h" 25 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h"
25 #include "chrome/browser/ui/ash/launcher/desktop_shell_launcher_context_menu.h" 26 #include "chrome/browser/ui/ash/launcher/desktop_shell_launcher_context_menu.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 ash::ShelfItemDelegate* item_delegate = 120 ash::ShelfItemDelegate* item_delegate =
120 controller_->shelf_model()->GetShelfItemDelegate(item_.id); 121 controller_->shelf_model()->GetShelfItemDelegate(item_.id);
121 DCHECK(item_delegate); 122 DCHECK(item_delegate);
122 item_delegate->Close(); 123 item_delegate->Close();
123 } else { 124 } else {
124 // TODO(simonhong): Use ShelfItemDelegate::Close(). 125 // TODO(simonhong): Use ShelfItemDelegate::Close().
125 controller_->Close(item_.id); 126 controller_->Close(item_.id);
126 } 127 }
127 ash::ShellPort::Get()->RecordUserMetricsAction( 128 ash::ShellPort::Get()->RecordUserMetricsAction(
128 ash::UMA_CLOSE_THROUGH_CONTEXT_MENU); 129 ash::UMA_CLOSE_THROUGH_CONTEXT_MENU);
130 if (ash::Shell::Get()
131 ->maximize_mode_controller()
132 ->IsMaximizeModeWindowManagerEnabled()) {
133 ash::ShellPort::Get()->RecordUserMetricsAction(
134 ash::UMA_TABLET_WINDOW_CLOSE_THROUGH_CONTXT_MENU);
135 }
129 break; 136 break;
130 case MENU_PIN: 137 case MENU_PIN:
131 if (controller_->IsAppPinned(item_.id.app_id)) 138 if (controller_->IsAppPinned(item_.id.app_id))
132 controller_->UnpinAppWithID(item_.id.app_id); 139 controller_->UnpinAppWithID(item_.id.app_id);
133 else 140 else
134 controller_->PinAppWithID(item_.id.app_id); 141 controller_->PinAppWithID(item_.id.app_id);
135 break; 142 break;
136 case MENU_AUTO_HIDE: 143 case MENU_AUTO_HIDE:
137 shelf_->SetAutoHideBehavior(shelf_->auto_hide_behavior() == 144 shelf_->SetAutoHideBehavior(shelf_->auto_hide_behavior() ==
138 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS 145 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 case MENU_PIN: 209 case MENU_PIN:
203 case MENU_AUTO_HIDE: 210 case MENU_AUTO_HIDE:
204 case MENU_ALIGNMENT_MENU: 211 case MENU_ALIGNMENT_MENU:
205 case MENU_CHANGE_WALLPAPER: 212 case MENU_CHANGE_WALLPAPER:
206 LauncherContextMenu::ExecuteCommand(command_id, event_flags); 213 LauncherContextMenu::ExecuteCommand(command_id, event_flags);
207 return true; 214 return true;
208 default: 215 default:
209 return false; 216 return false;
210 } 217 }
211 } 218 }
OLDNEW
« no previous file with comments | « ash/wm/overview/window_selector_item.cc ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698