| Index: chrome/browser/ui/web_contents_sizer.cc
|
| diff --git a/chrome/browser/ui/web_contents_sizer.cc b/chrome/browser/ui/web_contents_sizer.cc
|
| index 60580df80f5902a8ee29c03207153a0c5e8b26ee..0a8b3aae7413d08f17098c2fa5f1d2368e1b4629 100644
|
| --- a/chrome/browser/ui/web_contents_sizer.cc
|
| +++ b/chrome/browser/ui/web_contents_sizer.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "chrome/browser/ui/web_contents_sizer.h"
|
|
|
| +#include "base/logging.h"
|
| #include "build/build_config.h"
|
| #include "content/public/browser/web_contents.h"
|
|
|
| @@ -12,15 +13,21 @@
|
| #elif defined(OS_ANDROID)
|
| #include "content/public/browser/render_widget_host_view.h"
|
| #endif
|
| +#include "content/public/browser/web_contents.h"
|
|
|
| void ResizeWebContents(content::WebContents* web_contents,
|
| const gfx::Rect& new_bounds) {
|
| + DCHECK(web_contents);
|
| #if defined(USE_AURA)
|
| + // TODO(miu): This direct manipulation of the aura::Window should be removed.
|
| + // Currently, this is requried because some callers of ResizeWebContents() do
|
| + // so just after a new WebContents is created, but before the
|
| + // RenderWidgetHostView for the main frame has not been created yet.
|
| + // http://crbug.com/693953
|
| aura::Window* window = web_contents->GetNativeView();
|
| window->SetBounds(gfx::Rect(window->bounds().origin(), new_bounds.size()));
|
| #elif defined(OS_ANDROID)
|
| - content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView();
|
| - if (view)
|
| - view->SetBounds(new_bounds);
|
| + if (auto* view = web_contents->GetRenderWidgetHostView())
|
| + view->SetSize(new_bounds.size());
|
| #endif
|
| }
|
|
|