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/ash/launcher/launcher_application_menu_item_model.h" | 5 #include "chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 | 42 |
43 bool LauncherApplicationMenuItemModel::IsCommandIdEnabled( | 43 bool LauncherApplicationMenuItemModel::IsCommandIdEnabled( |
44 int command_id) const { | 44 int command_id) const { |
45 DCHECK(command_id < static_cast<int>(launcher_items_.size())); | 45 DCHECK(command_id < static_cast<int>(launcher_items_.size())); |
46 return launcher_items_[command_id]->IsEnabled(); | 46 return launcher_items_[command_id]->IsEnabled(); |
47 } | 47 } |
48 | 48 |
49 bool LauncherApplicationMenuItemModel::GetAcceleratorForCommandId( | 49 bool LauncherApplicationMenuItemModel::GetAcceleratorForCommandId( |
50 int command_id, | 50 int command_id, |
51 ui::Accelerator* accelerator) { | 51 ui::Accelerator* accelerator) const { |
52 return false; | 52 return false; |
53 } | 53 } |
54 | 54 |
55 void LauncherApplicationMenuItemModel::ExecuteCommand(int command_id, | 55 void LauncherApplicationMenuItemModel::ExecuteCommand(int command_id, |
56 int event_flags) { | 56 int event_flags) { |
57 DCHECK(command_id < static_cast<int>(launcher_items_.size())); | 57 DCHECK(command_id < static_cast<int>(launcher_items_.size())); |
58 launcher_items_[command_id]->Execute(event_flags); | 58 launcher_items_[command_id]->Execute(event_flags); |
59 RecordMenuItemSelectedMetrics(command_id, GetNumMenuItemsEnabled()); | 59 RecordMenuItemSelectedMetrics(command_id, GetNumMenuItemsEnabled()); |
60 } | 60 } |
61 | 61 |
(...skipping 27 matching lines...) Expand all Loading... |
89 return num_menu_items_enabled; | 89 return num_menu_items_enabled; |
90 } | 90 } |
91 | 91 |
92 void LauncherApplicationMenuItemModel::RecordMenuItemSelectedMetrics( | 92 void LauncherApplicationMenuItemModel::RecordMenuItemSelectedMetrics( |
93 int command_id, | 93 int command_id, |
94 int num_menu_items_enabled) { | 94 int num_menu_items_enabled) { |
95 UMA_HISTOGRAM_COUNTS_100(kSelectedMenuItemIndexHistogramName, command_id); | 95 UMA_HISTOGRAM_COUNTS_100(kSelectedMenuItemIndexHistogramName, command_id); |
96 UMA_HISTOGRAM_COUNTS_100(kNumItemsEnabledHistogramName, | 96 UMA_HISTOGRAM_COUNTS_100(kNumItemsEnabledHistogramName, |
97 num_menu_items_enabled); | 97 num_menu_items_enabled); |
98 } | 98 } |
OLD | NEW |