Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / web_contents_sizer.cc
blobba7fff22173c2678ae9b2c736cd20c31dbf80168
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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/web_contents_sizer.h"
7 #include "content/public/browser/web_contents.h"
9 #if defined(USE_AURA)
10 #include "ui/aura/window.h"
11 #elif defined(OS_ANDROID)
12 #include "content/public/browser/render_widget_host_view.h"
13 #endif
15 void ResizeWebContents(content::WebContents* web_contents,
16 const gfx::Size& new_size) {
17 #if defined(USE_AURA)
18 aura::Window* window = web_contents->GetNativeView();
19 window->SetBounds(gfx::Rect(window->bounds().origin(), new_size));
20 #elif defined(OS_ANDROID)
21 content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView();
22 if (view)
23 view->SetSize(new_size);
24 #endif