| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "content/public/browser/browser_accessibility_state.h" | 10 #include "content/public/browser/browser_accessibility_state.h" |
| 11 #include "content/public/browser/browser_context.h" | 11 #include "content/public/browser/browser_context.h" |
| 12 #include "content/public/browser/navigation_controller.h" | 12 #include "content/public/browser/navigation_controller.h" |
| 13 #include "content/public/browser/render_process_host.h" | 13 #include "content/public/browser/render_process_host.h" |
| 14 #include "content/public/browser/render_view_host.h" | 14 #include "content/public/browser/render_view_host.h" |
| 15 #include "content/public/browser/render_widget_host_view.h" | 15 #include "content/public/browser/render_widget_host_view.h" |
| 16 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
| 17 #include "ipc/ipc_message.h" | 17 #include "ipc/ipc_message.h" |
| 18 #include "ui/accessibility/ax_enums.h" | 18 #include "ui/accessibility/ax_enums.h" |
| 19 #include "ui/accessibility/ax_view_state.h" | 19 #include "ui/accessibility/ax_node_data.h" |
| 20 #include "ui/events/event.h" | 20 #include "ui/events/event.h" |
| 21 #include "ui/views/controls/native/native_view_host.h" | 21 #include "ui/views/controls/native/native_view_host.h" |
| 22 #include "ui/views/focus/focus_manager.h" | 22 #include "ui/views/focus/focus_manager.h" |
| 23 #include "ui/views/views_delegate.h" | 23 #include "ui/views/views_delegate.h" |
| 24 | 24 |
| 25 namespace views { | 25 namespace views { |
| 26 | 26 |
| 27 // static | 27 // static |
| 28 const char WebView::kViewClassName[] = "WebView"; | 28 const char WebView::kViewClassName[] = "WebView"; |
| 29 | 29 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 void WebView::OnFocus() { | 207 void WebView::OnFocus() { |
| 208 if (web_contents()) | 208 if (web_contents()) |
| 209 web_contents()->Focus(); | 209 web_contents()->Focus(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 void WebView::AboutToRequestFocusFromTabTraversal(bool reverse) { | 212 void WebView::AboutToRequestFocusFromTabTraversal(bool reverse) { |
| 213 if (web_contents()) | 213 if (web_contents()) |
| 214 web_contents()->FocusThroughTabTraversal(reverse); | 214 web_contents()->FocusThroughTabTraversal(reverse); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void WebView::GetAccessibleState(ui::AXViewState* state) { | 217 void WebView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 218 state->role = ui::AX_ROLE_WEB_VIEW; | 218 node_data->role = ui::AX_ROLE_WEB_VIEW; |
| 219 } | 219 } |
| 220 | 220 |
| 221 gfx::NativeViewAccessible WebView::GetNativeViewAccessible() { | 221 gfx::NativeViewAccessible WebView::GetNativeViewAccessible() { |
| 222 if (web_contents()) { | 222 if (web_contents()) { |
| 223 content::RenderWidgetHostView* host_view = | 223 content::RenderWidgetHostView* host_view = |
| 224 web_contents()->GetRenderWidgetHostView(); | 224 web_contents()->GetRenderWidgetHostView(); |
| 225 if (host_view) | 225 if (host_view) |
| 226 return host_view->GetNativeViewAccessible(); | 226 return host_view->GetNativeViewAccessible(); |
| 227 } | 227 } |
| 228 return View::GetNativeViewAccessible(); | 228 return View::GetNativeViewAccessible(); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 if (!contents) { | 383 if (!contents) { |
| 384 content::WebContents::CreateParams create_params( | 384 content::WebContents::CreateParams create_params( |
| 385 browser_context, NULL); | 385 browser_context, NULL); |
| 386 return content::WebContents::Create(create_params); | 386 return content::WebContents::Create(create_params); |
| 387 } | 387 } |
| 388 | 388 |
| 389 return contents; | 389 return contents; |
| 390 } | 390 } |
| 391 | 391 |
| 392 } // namespace views | 392 } // namespace views |
| OLD | NEW |