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

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: Created 6 years, 7 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
« no previous file with comments | « chrome/browser/ui/browser_commands.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index 62529595f58be5241f5814edc03c0d6ce0c2a9dd..78756d1fd545c8482b8493731b22dc122ba27f5b 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -959,6 +959,25 @@ void Zoom(Browser* browser, content::PageZoom zoom) {
zoom);
}
+bool CanZoomIn(content::WebContents *contents) {
Ben Goodger (Google) 2014/06/05 15:45:03 nit: WebContents* contents here, and in the subseq
sarka 2014/06/05 19:55:05 Done.
sarka 2014/06/05 19:55:05 Done.
+ bool dummy = false;
+ return contents->GetZoomPercent(&dummy,
+ &dummy) == contents->GetMaximumZoomPercent() + 1 ? false : true;
Ben Goodger (Google) 2014/06/05 15:45:03 I'd write these as: return contents->GetZoomPerce
sarka 2014/06/05 19:55:05 Done.
+}
+
+bool CanZoomOut(content::WebContents *contents) {
+ bool dummy = false;
+ return contents->GetZoomPercent(&dummy,
+ &dummy) == contents->GetMinimumZoomPercent() ? false : true;
+}
+
+bool ActualSize(content::WebContents *contents) {
+ bool dummy = false;
+ return contents->GetZoomPercent(&dummy,
+ &dummy) == 100 ? false : true;
+}
+
+
void FocusToolbar(Browser* browser) {
content::RecordAction(UserMetricsAction("FocusToolbar"));
browser->window()->FocusToolbar();
« no previous file with comments | « chrome/browser/ui/browser_commands.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698