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

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

Issue 678343002: Default zoom was never read from chrome://settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rouding off double value for the minimum zoom factor Created 5 years, 11 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 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 UpdateCommandsForFind(); 1128 UpdateCommandsForFind();
1129 // Update the zoom commands when an active tab is selected. 1129 // Update the zoom commands when an active tab is selected.
1130 UpdateCommandsForZoomState(); 1130 UpdateCommandsForZoomState();
1131 } 1131 }
1132 1132
1133 void BrowserCommandController::UpdateCommandsForZoomState() { 1133 void BrowserCommandController::UpdateCommandsForZoomState() {
1134 WebContents* contents = 1134 WebContents* contents =
1135 browser_->tab_strip_model()->GetActiveWebContents(); 1135 browser_->tab_strip_model()->GetActiveWebContents();
1136 if (!contents) 1136 if (!contents)
1137 return; 1137 return;
1138 command_updater_.UpdateCommandEnabled(IDC_ZOOM_PLUS, CanZoomIn(contents)); 1138 command_updater_.UpdateCommandEnabled(IDC_ZOOM_PLUS,
1139 command_updater_.UpdateCommandEnabled(IDC_ZOOM_NORMAL, ActualSize(contents)); 1139 IsAtMaximumZoom(contents));
1140 command_updater_.UpdateCommandEnabled(IDC_ZOOM_MINUS, CanZoomOut(contents)); 1140 command_updater_.UpdateCommandEnabled(IDC_ZOOM_NORMAL,
1141 !IsAtDefaultZoom(contents));
1142 command_updater_.UpdateCommandEnabled(IDC_ZOOM_MINUS,
1143 IsAtMinimumZoom(contents));
1141 } 1144 }
1142 1145
1143 void BrowserCommandController::UpdateCommandsForContentRestrictionState() { 1146 void BrowserCommandController::UpdateCommandsForContentRestrictionState() {
1144 int restrictions = GetContentRestrictions(browser_); 1147 int restrictions = GetContentRestrictions(browser_);
1145 1148
1146 command_updater_.UpdateCommandEnabled( 1149 command_updater_.UpdateCommandEnabled(
1147 IDC_COPY, !(restrictions & CONTENT_RESTRICTION_COPY)); 1150 IDC_COPY, !(restrictions & CONTENT_RESTRICTION_COPY));
1148 command_updater_.UpdateCommandEnabled( 1151 command_updater_.UpdateCommandEnabled(
1149 IDC_CUT, !(restrictions & CONTENT_RESTRICTION_CUT)); 1152 IDC_CUT, !(restrictions & CONTENT_RESTRICTION_CUT));
1150 command_updater_.UpdateCommandEnabled( 1153 command_updater_.UpdateCommandEnabled(
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 1349
1347 BrowserWindow* BrowserCommandController::window() { 1350 BrowserWindow* BrowserCommandController::window() {
1348 return browser_->window(); 1351 return browser_->window();
1349 } 1352 }
1350 1353
1351 Profile* BrowserCommandController::profile() { 1354 Profile* BrowserCommandController::profile() {
1352 return browser_->profile(); 1355 return browser_->profile();
1353 } 1356 }
1354 1357
1355 } // namespace chrome 1358 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698