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

Side by Side Diff: chrome/browser/ui/toolbar/app_menu_model.cc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: simplify type checking Created 3 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/toolbar/app_menu_model.h" 5 #include "chrome/browser/ui/toolbar/app_menu_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 LogMenuAction(MENU_ACTION_EXIT); 576 LogMenuAction(MENU_ACTION_EXIT);
577 break; 577 break;
578 } 578 }
579 579
580 if (!uma_action_recorded_) { 580 if (!uma_action_recorded_) {
581 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction", delta); 581 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction", delta);
582 uma_action_recorded_ = true; 582 uma_action_recorded_ = true;
583 } 583 }
584 } 584 }
585 585
586 void AppMenuModel::LogMenuAction(int action_id) { 586 void AppMenuModel::LogMenuAction(AppMenuAction action_id) {
587 UMA_HISTOGRAM_ENUMERATION("WrenchMenu.MenuAction", action_id, 587 UMA_HISTOGRAM_ENUMERATION("WrenchMenu.MenuAction", action_id,
588 LIMIT_MENU_ACTION); 588 LIMIT_MENU_ACTION);
589 } 589 }
590 590
591 bool AppMenuModel::IsCommandIdChecked(int command_id) const { 591 bool AppMenuModel::IsCommandIdChecked(int command_id) const {
592 if (command_id == IDC_SHOW_BOOKMARK_BAR) { 592 if (command_id == IDC_SHOW_BOOKMARK_BAR) {
593 return browser_->profile()->GetPrefs()->GetBoolean( 593 return browser_->profile()->GetPrefs()->GetBoolean(
594 bookmarks::prefs::kShowBookmarkBar); 594 bookmarks::prefs::kShowBookmarkBar);
595 } else if (command_id == IDC_PROFILING_ENABLED) { 595 } else if (command_id == IDC_PROFILING_ENABLED) {
596 return Profiling::BeingProfiled(); 596 return Profiling::BeingProfiled();
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 browser_->tab_strip_model()->GetActiveWebContents()) 856 browser_->tab_strip_model()->GetActiveWebContents())
857 ->GetZoomPercent(); 857 ->GetZoomPercent();
858 } 858 }
859 zoom_label_ = base::FormatPercent(zoom_percent); 859 zoom_label_ = base::FormatPercent(zoom_percent);
860 } 860 }
861 861
862 void AppMenuModel::OnZoomLevelChanged( 862 void AppMenuModel::OnZoomLevelChanged(
863 const content::HostZoomMap::ZoomLevelChange& change) { 863 const content::HostZoomMap::ZoomLevelChange& change) {
864 UpdateZoomControls(); 864 UpdateZoomControls();
865 } 865 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/app_menu_model.h ('k') | chrome/browser/ui/webui/app_launcher_login_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698