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

Unified Diff: ui/views/controls/webview/webview.cc

Issue 10388203: [Views, WebIntents] Enable auto-resizing for WebContents (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Re-base to HEAD Created 8 years, 7 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 | « ui/views/controls/webview/webview.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/webview/webview.cc
diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc
index b6825d15159fd13b09e8efd6a2787289baede75a..475480396adffd268a64f70651890e5a3e57f29d 100644
--- a/ui/views/controls/webview/webview.cc
+++ b/ui/views/controls/webview/webview.cc
@@ -79,6 +79,10 @@ void WebView::OnWebContentsFocused(content::WebContents* web_contents) {
focus_manager->SetFocusedView(this);
}
+void WebView::SetPreferredSize(const gfx::Size& preferred_size) {
+ preferred_size_ = preferred_size;
+}
+
////////////////////////////////////////////////////////////////////////////////
// WebView, View overrides:
@@ -137,6 +141,13 @@ gfx::NativeViewAccessible WebView::GetNativeViewAccessible() {
return View::GetNativeViewAccessible();
}
+gfx::Size WebView::GetPreferredSize() {
+ if (preferred_size_ == gfx::Size())
+ return View::GetPreferredSize();
+ else
+ return preferred_size_;
+}
+
////////////////////////////////////////////////////////////////////////////////
// WebView, content::NotificationObserver implementation:
« no previous file with comments | « ui/views/controls/webview/webview.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698