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

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

Issue 2695093005: Remove RWHV::SetBounds() from the public API, and make comments clearer.
Patch Set: Revert web_contents_sizer to its previous shenanigans (http://crbug.com/693953). Created 3 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/web_contents_sizer.h ('k') | chrome/browser/ui/web_contents_sizer.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
}
« no previous file with comments | « chrome/browser/ui/web_contents_sizer.h ('k') | chrome/browser/ui/web_contents_sizer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698