Chromium Code Reviews| Index: ui/gfx/layout_util.cc |
| diff --git a/ui/gfx/layout_util.cc b/ui/gfx/layout_util.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..309e9a7cda3fe63a0fbdb8fd2836ec53d01f684b |
| --- /dev/null |
| +++ b/ui/gfx/layout_util.cc |
| @@ -0,0 +1,35 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "ui/gfx/layout_util.h" |
| + |
| +#include "content/public/browser/web_contents.h" |
| +#include "content/public/browser/web_contents_view.h" |
| + |
| +#if defined(USE_AURA) |
| +#include "ui/aura/window.h" |
| +#elif defined(TOOLKIT_GTK) |
| +#include <gtk/gtk.h> |
| +#elif defined(OS_ANDROID) |
| +#endif |
| + |
| +namespace gfx { |
| + |
| +void ResizeWebContents(content::WebContents* web_contents, |
| + const gfx::Size& new_size) { |
| +#if defined(USE_AURA) |
| + gfx::NativeView view = web_contents->GetView()->GetNativeView(); |
| + gfx::Rect rect = view->bounds(); |
| + rect.set_size(new_size); |
| + view->SetBounds(rect); |
| +#elif defined(TOOLKIT_GTK) |
| + gfx::NativeView view = web_contents->GetView()->GetNativeView(); |
| + gtk_widget_set_size_request(view, new_size.width(), new_size.height()); |
| +#elif defined(OS_ANDROID) |
| + content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView(); |
|
sky
2014/04/02 14:39:42
Is it possible to use the android implementation e
erikchen
2014/04/02 17:10:41
The android implementation is different from the m
sky
2014/04/02 19:55:45
Actually, why is android resizing the RWHV but the
|
| + view->SetSize(new_size); |
| +#endif |
| +} |
| + |
| +} // namespace gfx |