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/wrench_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/wrench_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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 // FullscreenController since we want to be able to distinguish this event | 414 // FullscreenController since we want to be able to distinguish this event |
415 // and a menu which is under development. | 415 // and a menu which is under development. |
416 content::RecordAction(UserMetricsAction("EnterFullScreenWithWrenchMenu")); | 416 content::RecordAction(UserMetricsAction("EnterFullScreenWithWrenchMenu")); |
417 } | 417 } |
418 | 418 |
419 chrome::ExecuteCommand(browser_, command_id); | 419 chrome::ExecuteCommand(browser_, command_id); |
420 } | 420 } |
421 | 421 |
422 bool WrenchMenuModel::IsCommandIdChecked(int command_id) const { | 422 bool WrenchMenuModel::IsCommandIdChecked(int command_id) const { |
423 if (command_id == IDC_SHOW_BOOKMARK_BAR) { | 423 if (command_id == IDC_SHOW_BOOKMARK_BAR) { |
424 return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar); | 424 return browser_->profile()->GetPrefs()->GetBoolean( |
| 425 bookmarks::prefs::kShowBookmarkBar); |
425 } else if (command_id == IDC_PROFILING_ENABLED) { | 426 } else if (command_id == IDC_PROFILING_ENABLED) { |
426 return Profiling::BeingProfiled(); | 427 return Profiling::BeingProfiled(); |
427 } else if (command_id == IDC_TOGGLE_REQUEST_TABLET_SITE) { | 428 } else if (command_id == IDC_TOGGLE_REQUEST_TABLET_SITE) { |
428 return chrome::IsRequestingTabletSite(browser_); | 429 return chrome::IsRequestingTabletSite(browser_); |
429 } | 430 } |
430 | 431 |
431 return false; | 432 return false; |
432 } | 433 } |
433 | 434 |
434 bool WrenchMenuModel::IsCommandIdEnabled(int command_id) const { | 435 bool WrenchMenuModel::IsCommandIdEnabled(int command_id) const { |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 ->GetZoomPercent(); | 795 ->GetZoomPercent(); |
795 } | 796 } |
796 zoom_label_ = l10n_util::GetStringFUTF16( | 797 zoom_label_ = l10n_util::GetStringFUTF16( |
797 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 798 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
798 } | 799 } |
799 | 800 |
800 void WrenchMenuModel::OnZoomLevelChanged( | 801 void WrenchMenuModel::OnZoomLevelChanged( |
801 const content::HostZoomMap::ZoomLevelChange& change) { | 802 const content::HostZoomMap::ZoomLevelChange& change) { |
802 UpdateZoomControls(); | 803 UpdateZoomControls(); |
803 } | 804 } |
OLD | NEW |