| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |