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

Unified Diff: chrome/browser/ui/browser_commands.cc

Issue 310913002: Issue 32919: Update the Zoom NSMenuItems (Zoom-In/Zoom-out/Actual-Size) when the zoom state changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cross-platform unittest for Issue 32919 Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index 38cff6b408d594efa8b93cd183bc8a836b59002f..cc27c62c269fa838f224d1ddcebe45b25982d5c1 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -574,6 +574,23 @@ void CloseTab(Browser* browser) {
browser->tab_strip_model()->CloseSelectedTabs();
}
+bool CanZoomIn(content::WebContents* contents) {
+ bool dummy = false;
+ return contents->GetZoomPercent(&dummy, &dummy) !=
+ contents->GetMaximumZoomPercent() + 1;
Alexei Svitkine (slow) 2014/06/16 17:41:46 Nit: indent is wrong, same below.
+}
+
+bool CanZoomOut(content::WebContents* contents) {
+ bool dummy = false;
+ return contents->GetZoomPercent(&dummy, &dummy) !=
+ contents->GetMinimumZoomPercent();
+}
+
+bool ActualSize(content::WebContents* contents) {
+ bool dummy = false;
+ return contents->GetZoomPercent(&dummy, &dummy) != 100.0f;
+}
+
void RestoreTab(Browser* browser) {
content::RecordAction(UserMetricsAction("RestoreTab"));
TabRestoreService* service =

Powered by Google App Engine
This is Rietveld 408576698