| 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 28 matching lines...) Expand all Loading... |
| 39 int command_id) const { | 39 int command_id) const { |
| 40 return false; | 40 return false; |
| 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( | |
| 50 int command_id, | |
| 51 ui::Accelerator* accelerator) const { | |
| 52 return false; | |
| 53 } | |
| 54 | |
| 55 void LauncherApplicationMenuItemModel::ExecuteCommand(int command_id, | 49 void LauncherApplicationMenuItemModel::ExecuteCommand(int command_id, |
| 56 int event_flags) { | 50 int event_flags) { |
| 57 DCHECK(command_id < static_cast<int>(launcher_items_.size())); | 51 DCHECK(command_id < static_cast<int>(launcher_items_.size())); |
| 58 launcher_items_[command_id]->Execute(event_flags); | 52 launcher_items_[command_id]->Execute(event_flags); |
| 59 RecordMenuItemSelectedMetrics(command_id, GetNumMenuItemsEnabled()); | 53 RecordMenuItemSelectedMetrics(command_id, GetNumMenuItemsEnabled()); |
| 60 } | 54 } |
| 61 | 55 |
| 62 void LauncherApplicationMenuItemModel::Build() { | 56 void LauncherApplicationMenuItemModel::Build() { |
| 63 if (launcher_items_.empty()) | 57 if (launcher_items_.empty()) |
| 64 return; | 58 return; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 89 return num_menu_items_enabled; | 83 return num_menu_items_enabled; |
| 90 } | 84 } |
| 91 | 85 |
| 92 void LauncherApplicationMenuItemModel::RecordMenuItemSelectedMetrics( | 86 void LauncherApplicationMenuItemModel::RecordMenuItemSelectedMetrics( |
| 93 int command_id, | 87 int command_id, |
| 94 int num_menu_items_enabled) { | 88 int num_menu_items_enabled) { |
| 95 UMA_HISTOGRAM_COUNTS_100(kSelectedMenuItemIndexHistogramName, command_id); | 89 UMA_HISTOGRAM_COUNTS_100(kSelectedMenuItemIndexHistogramName, command_id); |
| 96 UMA_HISTOGRAM_COUNTS_100(kNumItemsEnabledHistogramName, | 90 UMA_HISTOGRAM_COUNTS_100(kNumItemsEnabledHistogramName, |
| 97 num_menu_items_enabled); | 91 num_menu_items_enabled); |
| 98 } | 92 } |
| OLD | NEW |