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

Unified Diff: apps/ui/web_contents_sizer.cc

Issue 209023003: Remove references to WebContentsView::SizeContents from chrome/ and app/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Alphabetization. Created 6 years, 9 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 | « apps/ui/web_contents_sizer.h ('k') | apps/ui/web_contents_sizer.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/ui/web_contents_sizer.cc
diff --git a/apps/ui/web_contents_sizer.cc b/apps/ui/web_contents_sizer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4d0d00c54d2631f3b18924fdcf5b19e6447b8ef0
--- /dev/null
+++ b/apps/ui/web_contents_sizer.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 "apps/ui/web_contents_sizer.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
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
+
+namespace apps {
+
+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();
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.
+ 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();
+ view->SetSize(new_size);
+#endif
+}
+
+} // namespace apps
« no previous file with comments | « apps/ui/web_contents_sizer.h ('k') | apps/ui/web_contents_sizer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698