summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/browser/renderer_host/render_widget_host_impl.cc8
-rw-r--r--content/browser/renderer_host/render_widget_host_unittest.cc6
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac.h2
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac.mm8
-rw-r--r--content/browser/renderer_host/test_render_view_host.cc4
-rw-r--r--content/browser/renderer_host/test_render_view_host.h1
-rw-r--r--content/port/browser/render_widget_host_view_port.h6
7 files changed, 2 insertions, 33 deletions
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 6a542e0..6a449ce 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -406,15 +406,7 @@ void RenderWidgetHostImpl::WasResized() {
return;
}
-#if !defined(OS_MACOSX)
gfx::Rect view_bounds = view_->GetViewBounds();
-#else
- // When UI scaling is enabled on OS X, allocate a smaller bitmap and
- // pixel-scale it up.
- // TODO(thakis): Use pixel size on mac and set UI scale in renderer.
- // http://crbug.com/31960
- gfx::Rect view_bounds(view_->GetViewCocoaBounds().size());
-#endif
gfx::Size new_size(view_bounds.size());
bool was_fullscreen = is_fullscreen_;
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index c1ea36c..d344ed4 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -140,12 +140,6 @@ class TestView : public content::TestRenderWidgetHostView {
return bounds_;
}
-#if defined(OS_MACOSX)
- virtual gfx::Rect GetViewCocoaBounds() const {
- return bounds_;
- }
-#endif
-
protected:
gfx::Rect bounds_;
DISALLOW_COPY_AND_ASSIGN(TestView);
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
index b808699..b3e41d7 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -240,8 +240,6 @@ class RenderWidgetHostViewMac : public content::RenderWidgetHostViewBase {
skia::PlatformCanvas* output,
base::Callback<void(bool)> callback) OVERRIDE;
virtual void OnAcceleratedCompositingStateChange() OVERRIDE;
- // See comment in RenderWidgetHostView!
- virtual gfx::Rect GetViewCocoaBounds() const OVERRIDE;
virtual void OnAccessibilityNotifications(
const std::vector<AccessibilityHostMsg_NotificationParams>& params
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 4ddcaa0..05415f6 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -546,14 +546,14 @@ bool RenderWidgetHostViewMac::IsShowing() {
}
gfx::Rect RenderWidgetHostViewMac::GetViewBounds() const {
+ NSRect bounds = [cocoa_view_ bounds];
// TODO(shess): In case of !window, the view has been removed from
// the view hierarchy because the tab isn't main. Could retrieve
// the information from the main tab for our window.
NSWindow* enclosing_window = ApparentWindowForView(cocoa_view_);
if (!enclosing_window)
- return gfx::Rect();
+ return gfx::Rect(gfx::Size(NSWidth(bounds), NSHeight(bounds)));
- NSRect bounds = [cocoa_view_ bounds];
bounds = [cocoa_view_ convertRect:bounds toView:nil];
bounds.origin = [enclosing_window convertBaseToScreen:bounds.origin];
return FlipNSRectToRectScreen(bounds);
@@ -1201,10 +1201,6 @@ void RenderWidgetHostViewMac::GotSoftwareFrame() {
}
}
-gfx::Rect RenderWidgetHostViewMac::GetViewCocoaBounds() const {
- return gfx::Rect(NSRectToCGRect([cocoa_view_ bounds]));
-}
-
void RenderWidgetHostViewMac::SetActive(bool active) {
if (render_widget_host_)
render_widget_host_->SetActive(active);
diff --git a/content/browser/renderer_host/test_render_view_host.cc b/content/browser/renderer_host/test_render_view_host.cc
index 5628687..b9bdccf 100644
--- a/content/browser/renderer_host/test_render_view_host.cc
+++ b/content/browser/renderer_host/test_render_view_host.cc
@@ -132,10 +132,6 @@ bool TestRenderWidgetHostView::HasAcceleratedSurface(
void TestRenderWidgetHostView::AboutToWaitForBackingStoreMsg() {
}
-gfx::Rect TestRenderWidgetHostView::GetViewCocoaBounds() const {
- return gfx::Rect();
-}
-
void TestRenderWidgetHostView::SetActive(bool active) {
// <viettrungluu@gmail.com>: Do I need to do anything here?
}
diff --git a/content/browser/renderer_host/test_render_view_host.h b/content/browser/renderer_host/test_render_view_host.h
index aa12d36..56f474f 100644
--- a/content/browser/renderer_host/test_render_view_host.h
+++ b/content/browser/renderer_host/test_render_view_host.h
@@ -113,7 +113,6 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase {
virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE;
#if defined(OS_MACOSX)
virtual void AboutToWaitForBackingStoreMsg() OVERRIDE;
- virtual gfx::Rect GetViewCocoaBounds() const OVERRIDE;
virtual void PluginFocusChanged(bool focused, int plugin_id) OVERRIDE;
virtual void StartPluginIme() OVERRIDE;
virtual bool PostProcessEventForPluginIme(
diff --git a/content/port/browser/render_widget_host_view_port.h b/content/port/browser/render_widget_host_view_port.h
index 605632d..310be75 100644
--- a/content/port/browser/render_widget_host_view_port.h
+++ b/content/port/browser/render_widget_host_view_port.h
@@ -183,12 +183,6 @@ class CONTENT_EXPORT RenderWidgetHostViewPort : public RenderWidgetHostView {
// Called just before GetBackingStore blocks for an updated frame.
virtual void AboutToWaitForBackingStoreMsg() = 0;
- // Retrieve the bounds of the view, in cocoa view coordinates.
- // If the UI scale factor is 2, |GetViewBounds()| will return a size of e.g.
- // (400, 300) in pixels, while this method will return (200, 150).
- // Even though this returns an gfx::Rect, the result is NOT IN PIXELS.
- virtual gfx::Rect GetViewCocoaBounds() const = 0;
-
// Informs the view that a plugin gained or lost focus.
virtual void PluginFocusChanged(bool focused, int plugin_id) = 0;