| Index: chrome/browser/ui/browser_command_controller.cc
|
| diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
|
| index 9ad358f8b0a4821070655184d386a20c195ae123..0886bda1f308259ba503399c8b89aa2d6b5fd3bc 100644
|
| --- a/chrome/browser/ui/browser_command_controller.cc
|
| +++ b/chrome/browser/ui/browser_command_controller.cc
|
| @@ -318,6 +318,10 @@ void BrowserCommandController::TabStateChanged() {
|
| UpdateCommandsForTabState();
|
| }
|
|
|
| +void BrowserCommandController::ZoomStateChanged() {
|
| + UpdateCommandsForZoomState();
|
| +}
|
| +
|
| void BrowserCommandController::ContentRestrictionsChanged() {
|
| UpdateCommandsForContentRestrictionState();
|
| }
|
| @@ -946,7 +950,7 @@ void BrowserCommandController::InitCommandState() {
|
| // Zoom
|
| command_updater_.UpdateCommandEnabled(IDC_ZOOM_MENU, true);
|
| command_updater_.UpdateCommandEnabled(IDC_ZOOM_PLUS, true);
|
| - command_updater_.UpdateCommandEnabled(IDC_ZOOM_NORMAL, true);
|
| + command_updater_.UpdateCommandEnabled(IDC_ZOOM_NORMAL, false);
|
| command_updater_.UpdateCommandEnabled(IDC_ZOOM_MINUS, true);
|
|
|
| // Show various bits of UI
|
| @@ -1126,6 +1130,18 @@ void BrowserCommandController::UpdateCommandsForTabState() {
|
| UpdateCommandsForContentRestrictionState();
|
| UpdateCommandsForBookmarkEditing();
|
| UpdateCommandsForFind();
|
| + // Update the zoom commands when an active tab is selected.
|
| + UpdateCommandsForZoomState();
|
| +}
|
| +
|
| +void BrowserCommandController::UpdateCommandsForZoomState() {
|
| + WebContents* contents =
|
| + browser_->tab_strip_model()->GetActiveWebContents();
|
| + if (!contents)
|
| + return;
|
| + command_updater_.UpdateCommandEnabled(IDC_ZOOM_PLUS, CanZoomIn(contents));
|
| + command_updater_.UpdateCommandEnabled(IDC_ZOOM_NORMAL, ActualSize(contents));
|
| + command_updater_.UpdateCommandEnabled(IDC_ZOOM_MINUS, CanZoomOut(contents));
|
| }
|
|
|
| void BrowserCommandController::UpdateCommandsForContentRestrictionState() {
|
|
|