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

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
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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 command_updater_.UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE, 892 command_updater_.UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE,
893 CanReload(browser_)); 893 CanReload(browser_));
894 894
895 // Window management commands 895 // Window management commands
896 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, 896 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB,
897 !browser_->is_app() && CanDuplicateTab(browser_)); 897 !browser_->is_app() && CanDuplicateTab(browser_));
898 898
899 // Page-related commands 899 // Page-related commands
900 window()->SetStarredState( 900 window()->SetStarredState(
901 current_tab_contents->bookmark_tab_helper()->is_starred()); 901 current_tab_contents->bookmark_tab_helper()->is_starred());
902 window()->SetZoomIconState( 902 window()->ZoomChangedForActiveTab(false);
903 current_tab_contents->zoom_controller()->zoom_icon_state());
904 window()->SetZoomIconTooltipPercent(
905 current_tab_contents->zoom_controller()->zoom_percent());
906 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, 903 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE,
907 CanViewSource(browser_)); 904 CanViewSource(browser_));
908 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, 905 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION,
909 CanEmailPageLocation(browser_)); 906 CanEmailPageLocation(browser_));
910 if (browser_->is_devtools()) 907 if (browser_->is_devtools())
911 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false); 908 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false);
912 909
913 // Changing the encoding is not possible on Chrome-internal webpages. 910 // Changing the encoding is not possible on Chrome-internal webpages.
914 NavigationController& nc = current_web_contents->GetController(); 911 NavigationController& nc = current_web_contents->GetController();
915 bool is_chrome_internal = HasInternalURL(nc.GetActiveEntry()) || 912 bool is_chrome_internal = HasInternalURL(nc.GetActiveEntry()) ||
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 bool BrowserCommandController::IsFullScreenWindowOpen() { 1101 bool BrowserCommandController::IsFullScreenWindowOpen() {
1105 #if defined(USE_ASH) 1102 #if defined(USE_ASH)
1106 aura::Window* window = ash::wm::GetActiveWindow(); 1103 aura::Window* window = ash::wm::GetActiveWindow();
1107 return (window && ash::wm::IsWindowFullscreen(window)); 1104 return (window && ash::wm::IsWindowFullscreen(window));
1108 #else 1105 #else
1109 return false; 1106 return false;
1110 #endif 1107 #endif
1111 } 1108 }
1112 1109
1113 } // namespace chrome 1110 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698