Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #include "apps/ui/web_contents_sizer.h" | |
| 6 | |
| 7 #include "content/public/browser/web_contents.h" | |
| 8 #include "content/public/browser/web_contents_view.h" | |
| 9 | |
| 10 #if defined(USE_AURA) | |
| 11 #include "ui/aura/window.h" | |
| 12 #elif defined(TOOLKIT_GTK) | |
| 13 #include <gtk/gtk.h> | |
| 14 #elif defined(OS_ANDROID) | |
| 15 #endif | |
|
sky
2014/04/03 19:46:16
no reason for empty if here.
erikchen
2014/04/04 01:06:23
gladly, I was just trying to maintain consistency
| |
| 16 | |
| 17 namespace apps { | |
| 18 | |
| 19 void ResizeWebContents(content::WebContents* web_contents, | |
| 20 const gfx::Size& new_size) { | |
| 21 #if defined(USE_AURA) | |
| 22 gfx::NativeView view = web_contents->GetView()->GetNativeView(); | |
| 23 gfx::Rect rect = view->bounds(); | |
|
sky
2014/04/03 19:46:16
Simplify this to:
window->SetBounds(gfx::Rect(wind
erikchen
2014/04/04 01:06:23
I'm afraid I don't understand your comment. To the
sky
2014/04/04 14:18:03
My mistake. I was suggesting two things here:
1. N
erikchen
2014/04/04 20:47:53
Done.
| |
| 24 rect.set_size(new_size); | |
| 25 view->SetBounds(rect); | |
| 26 #elif defined(TOOLKIT_GTK) | |
| 27 gfx::NativeView view = web_contents->GetView()->GetNativeView(); | |
| 28 gtk_widget_set_size_request(view, new_size.width(), new_size.height()); | |
| 29 #elif defined(OS_ANDROID) | |
| 30 content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView(); | |
| 31 view->SetSize(new_size); | |
| 32 #endif | |
| 33 } | |
| 34 | |
| 35 } // namespace apps | |
| OLD | NEW |