| 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/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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |