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

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

Issue 10736028: Refactor browser window zoom handling and enable zoom icon on all platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 | Annotate | Revision Log
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 "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/defaults.h" 9 #include "chrome/browser/defaults.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 command_updater_.UpdateCommandEnabled(IDC_RELOAD_IGNORING_CACHE, 863 command_updater_.UpdateCommandEnabled(IDC_RELOAD_IGNORING_CACHE,
864 CanReload(browser_)); 864 CanReload(browser_));
865 865
866 // Window management commands 866 // Window management commands
867 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, 867 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB,
868 !browser_->is_app() && CanDuplicateTab(browser_)); 868 !browser_->is_app() && CanDuplicateTab(browser_));
869 869
870 // Page-related commands 870 // Page-related commands
871 window()->SetStarredState( 871 window()->SetStarredState(
872 current_tab_contents->bookmark_tab_helper()->is_starred()); 872 current_tab_contents->bookmark_tab_helper()->is_starred());
873 window()->SetZoomIconState( 873 window()->ZoomChangedForActiveTab(false);
874 current_tab_contents->zoom_controller()->zoom_icon_state());
875 window()->SetZoomIconTooltipPercent(
876 current_tab_contents->zoom_controller()->zoom_percent());
877 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, 874 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE,
878 CanViewSource(browser_)); 875 CanViewSource(browser_));
879 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, 876 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION,
880 CanEmailPageLocation(browser_)); 877 CanEmailPageLocation(browser_));
881 if (browser_->is_devtools()) 878 if (browser_->is_devtools())
882 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false); 879 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false);
883 880
884 // Changing the encoding is not possible on Chrome-internal webpages. 881 // Changing the encoding is not possible on Chrome-internal webpages.
885 NavigationController& nc = current_web_contents->GetController(); 882 NavigationController& nc = current_web_contents->GetController();
886 bool is_chrome_internal = HasInternalURL(nc.GetActiveEntry()) || 883 bool is_chrome_internal = HasInternalURL(nc.GetActiveEntry()) ||
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 1063
1067 BrowserWindow* BrowserCommandController::window() { 1064 BrowserWindow* BrowserCommandController::window() {
1068 return browser_->window(); 1065 return browser_->window();
1069 } 1066 }
1070 1067
1071 Profile* BrowserCommandController::profile() { 1068 Profile* BrowserCommandController::profile() {
1072 return browser_->profile(); 1069 return browser_->profile();
1073 } 1070 }
1074 1071
1075 } // namespace chrome 1072 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698