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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/web_contents_sizer.h" 5 #include "chrome/browser/ui/web_contents_sizer.h"
6 6
7 #include "base/logging.h"
7 #include "build/build_config.h" 8 #include "build/build_config.h"
8 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
9 10
10 #if defined(USE_AURA) 11 #if defined(USE_AURA)
11 #include "ui/aura/window.h" 12 #include "ui/aura/window.h"
12 #elif defined(OS_ANDROID) 13 #elif defined(OS_ANDROID)
13 #include "content/public/browser/render_widget_host_view.h" 14 #include "content/public/browser/render_widget_host_view.h"
14 #endif 15 #endif
16 #include "content/public/browser/web_contents.h"
15 17
16 void ResizeWebContents(content::WebContents* web_contents, 18 void ResizeWebContents(content::WebContents* web_contents,
17 const gfx::Rect& new_bounds) { 19 const gfx::Rect& new_bounds) {
20 DCHECK(web_contents);
18 #if defined(USE_AURA) 21 #if defined(USE_AURA)
22 // TODO(miu): This direct manipulation of the aura::Window should be removed.
23 // Currently, this is requried because some callers of ResizeWebContents() do
24 // so just after a new WebContents is created, but before the
25 // RenderWidgetHostView for the main frame has not been created yet.
26 // http://crbug.com/693953
19 aura::Window* window = web_contents->GetNativeView(); 27 aura::Window* window = web_contents->GetNativeView();
20 window->SetBounds(gfx::Rect(window->bounds().origin(), new_bounds.size())); 28 window->SetBounds(gfx::Rect(window->bounds().origin(), new_bounds.size()));
21 #elif defined(OS_ANDROID) 29 #elif defined(OS_ANDROID)
22 content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView(); 30 if (auto* view = web_contents->GetRenderWidgetHostView())
23 if (view) 31 view->SetSize(new_bounds.size());
24 view->SetBounds(new_bounds);
25 #endif 32 #endif
26 } 33 }
OLDNEW
« 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