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

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

Issue 2140963002: Added default implementations of GetAcceleratorForCommandId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@acceleratorprovider-const
Patch Set: Rebase. Created 4 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
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698