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

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, 4 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
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/browser_window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 command_updater_.UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE, 869 command_updater_.UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE,
870 CanReload(browser_)); 870 CanReload(browser_));
871 871
872 // Window management commands 872 // Window management commands
873 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, 873 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB,
874 !browser_->is_app() && CanDuplicateTab(browser_)); 874 !browser_->is_app() && CanDuplicateTab(browser_));
875 875
876 // Page-related commands 876 // Page-related commands
877 window()->SetStarredState( 877 window()->SetStarredState(
878 current_tab_contents->bookmark_tab_helper()->is_starred()); 878 current_tab_contents->bookmark_tab_helper()->is_starred());
879 window()->SetZoomIconState( 879 window()->ZoomChangedForActiveTab(false);
880 current_tab_contents->zoom_controller()->zoom_icon_state());
881 window()->SetZoomIconTooltipPercent(
882 current_tab_contents->zoom_controller()->zoom_percent());
883 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, 880 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE,
884 CanViewSource(browser_)); 881 CanViewSource(browser_));
885 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, 882 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION,
886 CanEmailPageLocation(browser_)); 883 CanEmailPageLocation(browser_));
887 if (browser_->is_devtools()) 884 if (browser_->is_devtools())
888 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false); 885 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false);
889 886
890 // Changing the encoding is not possible on Chrome-internal webpages. 887 // Changing the encoding is not possible on Chrome-internal webpages.
891 NavigationController& nc = current_web_contents->GetController(); 888 NavigationController& nc = current_web_contents->GetController();
892 bool is_chrome_internal = HasInternalURL(nc.GetActiveEntry()) || 889 bool is_chrome_internal = HasInternalURL(nc.GetActiveEntry()) ||
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 1069
1073 BrowserWindow* BrowserCommandController::window() { 1070 BrowserWindow* BrowserCommandController::window() {
1074 return browser_->window(); 1071 return browser_->window();
1075 } 1072 }
1076 1073
1077 Profile* BrowserCommandController::profile() { 1074 Profile* BrowserCommandController::profile() {
1078 return browser_->profile(); 1075 return browser_->profile();
1079 } 1076 }
1080 1077
1081 } // namespace chrome 1078 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698