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