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

Side by Side Diff: ui/views/controls/webview/webview.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/webview/webview.h ('k') | ui/views/examples/double_split_view_example.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/webview/webview.h" 5 #include "ui/views/controls/webview/webview.h"
6 6
7 #include "content/public/browser/browser_accessibility_state.h" 7 #include "content/public/browser/browser_accessibility_state.h"
8 #include "content/public/browser/browser_context.h" 8 #include "content/public/browser/browser_context.h"
9 #include "content/public/browser/navigation_controller.h" 9 #include "content/public/browser/navigation_controller.h"
10 #include "content/public/browser/render_view_host.h" 10 #include "content/public/browser/render_view_host.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 gfx::NativeViewAccessible WebView::GetNativeViewAccessible() { 217 gfx::NativeViewAccessible WebView::GetNativeViewAccessible() {
218 if (web_contents()) { 218 if (web_contents()) {
219 content::RenderWidgetHostView* host_view = 219 content::RenderWidgetHostView* host_view =
220 web_contents()->GetRenderWidgetHostView(); 220 web_contents()->GetRenderWidgetHostView();
221 if (host_view) 221 if (host_view)
222 return host_view->GetNativeViewAccessible(); 222 return host_view->GetNativeViewAccessible();
223 } 223 }
224 return View::GetNativeViewAccessible(); 224 return View::GetNativeViewAccessible();
225 } 225 }
226 226
227 gfx::Size WebView::GetPreferredSize() { 227 gfx::Size WebView::GetPreferredSize() const {
228 if (preferred_size_ == gfx::Size()) 228 if (preferred_size_ == gfx::Size())
229 return View::GetPreferredSize(); 229 return View::GetPreferredSize();
230 else 230 else
231 return preferred_size_; 231 return preferred_size_;
232 } 232 }
233 233
234 //////////////////////////////////////////////////////////////////////////////// 234 ////////////////////////////////////////////////////////////////////////////////
235 // WebView, content::WebContentsDelegate implementation: 235 // WebView, content::WebContentsDelegate implementation:
236 236
237 void WebView::WebContentsFocused(content::WebContents* web_contents) { 237 void WebView::WebContentsFocused(content::WebContents* web_contents) {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 if (!contents) { 354 if (!contents) {
355 content::WebContents::CreateParams create_params( 355 content::WebContents::CreateParams create_params(
356 browser_context, NULL); 356 browser_context, NULL);
357 return content::WebContents::Create(create_params); 357 return content::WebContents::Create(create_params);
358 } 358 }
359 359
360 return contents; 360 return contents;
361 } 361 }
362 362
363 } // namespace views 363 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/webview/webview.h ('k') | ui/views/examples/double_split_view_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698