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

Side by Side Diff: ash/common/shelf/shelf_alignment_menu.cc

Issue 2063333002: mash: Move all ash UMA metrics to //ash/common/metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/common/metrics/user_metrics_action.h ('k') | ash/common/wm/wm_user_metrics_action.h » ('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 "ash/common/shelf/shelf_alignment_menu.h" 5 #include "ash/common/shelf/shelf_alignment_menu.h"
6 6
7 #include "ash/common/metrics/user_metrics_action.h"
7 #include "ash/common/shelf/shelf_types.h" 8 #include "ash/common/shelf/shelf_types.h"
8 #include "ash/common/shelf/wm_shelf.h" 9 #include "ash/common/shelf/wm_shelf.h"
9 #include "ash/common/wm/wm_user_metrics_action.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
11 #include "grit/ash_strings.h" 11 #include "grit/ash_strings.h"
12 12
13 namespace ash { 13 namespace ash {
14 14
15 ShelfAlignmentMenu::ShelfAlignmentMenu(WmShelf* wm_shelf) 15 ShelfAlignmentMenu::ShelfAlignmentMenu(WmShelf* wm_shelf)
16 : ui::SimpleMenuModel(nullptr), wm_shelf_(wm_shelf) { 16 : ui::SimpleMenuModel(nullptr), wm_shelf_(wm_shelf) {
17 DCHECK(wm_shelf_); 17 DCHECK(wm_shelf_);
18 const int align_group_id = 1; 18 const int align_group_id = 1;
19 set_delegate(this); 19 set_delegate(this);
(...skipping 30 matching lines...) Expand all
50 bool ShelfAlignmentMenu::GetAcceleratorForCommandId( 50 bool ShelfAlignmentMenu::GetAcceleratorForCommandId(
51 int command_id, 51 int command_id,
52 ui::Accelerator* accelerator) { 52 ui::Accelerator* accelerator) {
53 return false; 53 return false;
54 } 54 }
55 55
56 void ShelfAlignmentMenu::ExecuteCommand(int command_id, int event_flags) { 56 void ShelfAlignmentMenu::ExecuteCommand(int command_id, int event_flags) {
57 WmShell* shell = WmShell::Get(); 57 WmShell* shell = WmShell::Get();
58 switch (static_cast<MenuItem>(command_id)) { 58 switch (static_cast<MenuItem>(command_id)) {
59 case MENU_ALIGN_LEFT: 59 case MENU_ALIGN_LEFT:
60 shell->RecordUserMetricsAction( 60 shell->RecordUserMetricsAction(UMA_SHELF_ALIGNMENT_SET_LEFT);
61 wm::WmUserMetricsAction::SHELF_ALIGNMENT_SET_LEFT);
62 wm_shelf_->SetAlignment(SHELF_ALIGNMENT_LEFT); 61 wm_shelf_->SetAlignment(SHELF_ALIGNMENT_LEFT);
63 break; 62 break;
64 case MENU_ALIGN_BOTTOM: 63 case MENU_ALIGN_BOTTOM:
65 shell->RecordUserMetricsAction( 64 shell->RecordUserMetricsAction(UMA_SHELF_ALIGNMENT_SET_BOTTOM);
66 wm::WmUserMetricsAction::SHELF_ALIGNMENT_SET_BOTTOM);
67 wm_shelf_->SetAlignment(SHELF_ALIGNMENT_BOTTOM); 65 wm_shelf_->SetAlignment(SHELF_ALIGNMENT_BOTTOM);
68 break; 66 break;
69 case MENU_ALIGN_RIGHT: 67 case MENU_ALIGN_RIGHT:
70 shell->RecordUserMetricsAction( 68 shell->RecordUserMetricsAction(UMA_SHELF_ALIGNMENT_SET_RIGHT);
71 wm::WmUserMetricsAction::SHELF_ALIGNMENT_SET_RIGHT);
72 wm_shelf_->SetAlignment(SHELF_ALIGNMENT_RIGHT); 69 wm_shelf_->SetAlignment(SHELF_ALIGNMENT_RIGHT);
73 break; 70 break;
74 } 71 }
75 } 72 }
76 73
77 } // namespace ash 74 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/metrics/user_metrics_action.h ('k') | ash/common/wm/wm_user_metrics_action.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698