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

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

Issue 2133013002: AcceleratorProvider: Make GetAcceleratorForCommandId const. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix overrides on Mac and Chrome OS. Created 4 years, 5 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 30 matching lines...) Expand all
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698