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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 542193004: Browser Plugin: Report autosize view size in DIP instead of physical pixels (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/apps/web_view_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 89ab8fc5ef99e58450f97d8b5218336550993238..f582394a4db477a3541333cfb841a12ce9d735dd 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -36,6 +36,7 @@
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/drop_data.h"
#include "third_party/WebKit/public/platform/WebCursorInfo.h"
+#include "ui/gfx/geometry/size_conversions.h"
#if defined(OS_MACOSX)
#include "content/browser/browser_plugin/browser_plugin_popup_menu_helper_mac.h"
@@ -320,7 +321,10 @@ void BrowserPluginGuest::SwapCompositorFrame(
cc::RenderPass* root_pass =
frame->delegated_frame_data->render_pass_list.back();
- gfx::Size view_size(root_pass->output_rect.size());
+ gfx::Size view_size(gfx::ToFlooredSize(gfx::ScaleSize(
+ root_pass->output_rect.size(),
+ 1.0f / frame->metadata.device_scale_factor)));
+
if (last_seen_view_size_ != view_size) {
delegate_->GuestSizeChanged(last_seen_view_size_, view_size);
last_seen_view_size_ = view_size;
« no previous file with comments | « chrome/browser/apps/web_view_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698