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

Side by Side Diff: chrome/browser/ui/browser_command_controller.cc

Issue 954923005: Make command-zero reset page scale in addition to zoom level (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again again Created 5 years, 9 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/browser_command_controller.h" 5 #include "chrome/browser/ui/browser_command_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 } 1138 }
1139 1139
1140 void BrowserCommandController::UpdateCommandsForZoomState() { 1140 void BrowserCommandController::UpdateCommandsForZoomState() {
1141 WebContents* contents = 1141 WebContents* contents =
1142 browser_->tab_strip_model()->GetActiveWebContents(); 1142 browser_->tab_strip_model()->GetActiveWebContents();
1143 if (!contents) 1143 if (!contents)
1144 return; 1144 return;
1145 command_updater_.UpdateCommandEnabled(IDC_ZOOM_PLUS, 1145 command_updater_.UpdateCommandEnabled(IDC_ZOOM_PLUS,
1146 CanZoomIn(contents)); 1146 CanZoomIn(contents));
1147 command_updater_.UpdateCommandEnabled(IDC_ZOOM_NORMAL, 1147 command_updater_.UpdateCommandEnabled(IDC_ZOOM_NORMAL,
1148 !IsAtDefaultZoom(contents)); 1148 CanResetZoom(contents));
1149 command_updater_.UpdateCommandEnabled(IDC_ZOOM_MINUS, 1149 command_updater_.UpdateCommandEnabled(IDC_ZOOM_MINUS,
1150 CanZoomOut(contents)); 1150 CanZoomOut(contents));
1151 } 1151 }
1152 1152
1153 void BrowserCommandController::UpdateCommandsForContentRestrictionState() { 1153 void BrowserCommandController::UpdateCommandsForContentRestrictionState() {
1154 int restrictions = GetContentRestrictions(browser_); 1154 int restrictions = GetContentRestrictions(browser_);
1155 1155
1156 command_updater_.UpdateCommandEnabled( 1156 command_updater_.UpdateCommandEnabled(
1157 IDC_COPY, !(restrictions & CONTENT_RESTRICTION_COPY)); 1157 IDC_COPY, !(restrictions & CONTENT_RESTRICTION_COPY));
1158 command_updater_.UpdateCommandEnabled( 1158 command_updater_.UpdateCommandEnabled(
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 1356
1357 BrowserWindow* BrowserCommandController::window() { 1357 BrowserWindow* BrowserCommandController::window() {
1358 return browser_->window(); 1358 return browser_->window();
1359 } 1359 }
1360 1360
1361 Profile* BrowserCommandController::profile() { 1361 Profile* BrowserCommandController::profile() {
1362 return browser_->profile(); 1362 return browser_->profile();
1363 } 1363 }
1364 1364
1365 } // namespace chrome 1365 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_impl.cc ('k') | chrome/browser/ui/browser_commands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698