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

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

Issue 139983006: [DevTools] Handle frontend zoom similarly to tab zoom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Specific is_devtools check Created 6 years, 10 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.cc ('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 309ee6c7686184990201738fe66cbc99c65d5aea..53a31a6b461eddebab1bb84b79016ea5a9834f4f 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -68,6 +68,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
@@ -891,11 +892,16 @@ void FindInPage(Browser* browser, bool find_next, bool forward_direction) {
}
void Zoom(Browser* browser, content::PageZoom zoom) {
- if (browser->is_devtools())
+ WebContents* contents = browser->tab_strip_model()->GetActiveWebContents();
+ DevToolsWindow* devtools =
+ DevToolsWindow::GetDockedInstanceForInspectedTab(contents);
+ if (devtools && devtools->web_contents()->GetRenderWidgetHostView() &&
+ devtools->web_contents()->GetRenderWidgetHostView()->HasFocus()) {
+ chrome_page_zoom::Zoom(devtools->web_contents(), zoom);
return;
+ }
- chrome_page_zoom::Zoom(browser->tab_strip_model()->GetActiveWebContents(),
- zoom);
+ chrome_page_zoom::Zoom(contents, zoom);
}
void FocusToolbar(Browser* browser) {
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698