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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/process/kill.h" | 16 #include "base/process/kill.h" |
17 #include "content/browser/renderer_host/render_widget_host_impl.h" | 17 #include "content/browser/renderer_host/render_widget_host_impl.h" |
18 #include "content/browser/site_instance_impl.h" | 18 #include "content/browser/site_instance_impl.h" |
19 #include "content/common/drag_event_source_info.h" | 19 #include "content/common/drag_event_source_info.h" |
20 #include "content/public/browser/notification_observer.h" | 20 #include "content/public/browser/notification_observer.h" |
21 #include "content/public/browser/render_view_host.h" | 21 #include "content/public/browser/render_view_host.h" |
22 #include "content/public/common/window_container_type.h" | 22 #include "content/public/common/window_container_type.h" |
23 #include "net/base/load_states.h" | 23 #include "net/base/load_states.h" |
24 #include "third_party/WebKit/public/web/WebAXEnums.h" | 24 #include "third_party/WebKit/public/web/WebAXEnums.h" |
25 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 25 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
26 #include "third_party/WebKit/public/web/WebPopupType.h" | 26 #include "third_party/WebKit/public/web/WebPopupType.h" |
27 #include "third_party/skia/include/core/SkColor.h" | 27 #include "third_party/skia/include/core/SkColor.h" |
| 28 #include "ui/accessibility/ax_node_data.h" |
28 #include "ui/base/window_open_disposition.h" | 29 #include "ui/base/window_open_disposition.h" |
29 | 30 |
30 class SkBitmap; | 31 class SkBitmap; |
31 class FrameMsg_Navigate; | 32 class FrameMsg_Navigate; |
| 33 struct AccessibilityHostMsg_EventParams; |
| 34 struct AccessibilityHostMsg_LocationChangeParams; |
32 struct MediaPlayerAction; | 35 struct MediaPlayerAction; |
33 struct ViewHostMsg_CreateWindow_Params; | 36 struct ViewHostMsg_CreateWindow_Params; |
34 struct ViewHostMsg_ShowPopup_Params; | 37 struct ViewHostMsg_ShowPopup_Params; |
35 struct FrameMsg_Navigate_Params; | 38 struct FrameMsg_Navigate_Params; |
36 struct ViewMsg_PostMessage_Params; | 39 struct ViewMsg_PostMessage_Params; |
37 | 40 |
38 namespace base { | 41 namespace base { |
39 class ListValue; | 42 class ListValue; |
40 } | 43 } |
41 | 44 |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 void DidCancelPopupMenu(); | 401 void DidCancelPopupMenu(); |
399 #endif | 402 #endif |
400 | 403 |
401 int main_frame_routing_id() const { | 404 int main_frame_routing_id() const { |
402 return main_frame_routing_id_; | 405 return main_frame_routing_id_; |
403 } | 406 } |
404 | 407 |
405 // Set the opener to null in the renderer process. | 408 // Set the opener to null in the renderer process. |
406 void DisownOpener(); | 409 void DisownOpener(); |
407 | 410 |
| 411 // Turn on accessibility testing. The given callback will be run |
| 412 // every time an accessibility notification is received from the |
| 413 // renderer process, and the accessibility tree it sent can be |
| 414 // retrieved using accessibility_tree_for_testing(). |
| 415 void SetAccessibilityCallbackForTesting( |
| 416 const base::Callback<void(ui::AXEvent, int)>& callback); |
| 417 |
| 418 // Only valid if SetAccessibilityCallbackForTesting was called and |
| 419 // the callback was run at least once. Returns a snapshot of the |
| 420 // accessibility tree received from the renderer as of the last time |
| 421 // an accessibility notification was received. |
| 422 const ui::AXTree& ax_tree_for_testing() { |
| 423 CHECK(ax_tree_.get()); |
| 424 return *ax_tree_.get(); |
| 425 } |
| 426 |
| 427 // Set accessibility callbacks. |
| 428 void SetAccessibilityLayoutCompleteCallbackForTesting( |
| 429 const base::Closure& callback); |
| 430 void SetAccessibilityLoadCompleteCallbackForTesting( |
| 431 const base::Closure& callback); |
| 432 void SetAccessibilityOtherCallbackForTesting( |
| 433 const base::Closure& callback); |
| 434 |
408 bool is_waiting_for_beforeunload_ack() { | 435 bool is_waiting_for_beforeunload_ack() { |
409 return is_waiting_for_beforeunload_ack_; | 436 return is_waiting_for_beforeunload_ack_; |
410 } | 437 } |
411 | 438 |
412 // Whether the RVH is waiting for the unload ack from the renderer. | 439 // Whether the RVH is waiting for the unload ack from the renderer. |
413 bool IsWaitingForUnloadACK() const; | 440 bool IsWaitingForUnloadACK() const; |
414 | 441 |
415 void OnTextSurroundingSelectionResponse(const base::string16& content, | 442 void OnTextSurroundingSelectionResponse(const base::string16& content, |
416 size_t start_offset, | 443 size_t start_offset, |
417 size_t end_offset); | 444 size_t end_offset); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 const SkBitmap& bitmap, | 505 const SkBitmap& bitmap, |
479 const gfx::Vector2d& bitmap_offset_in_dip, | 506 const gfx::Vector2d& bitmap_offset_in_dip, |
480 const DragEventSourceInfo& event_info); | 507 const DragEventSourceInfo& event_info); |
481 void OnUpdateDragCursor(blink::WebDragOperation drag_operation); | 508 void OnUpdateDragCursor(blink::WebDragOperation drag_operation); |
482 void OnTargetDropACK(); | 509 void OnTargetDropACK(); |
483 void OnTakeFocus(bool reverse); | 510 void OnTakeFocus(bool reverse); |
484 void OnFocusedNodeChanged(bool is_editable_node); | 511 void OnFocusedNodeChanged(bool is_editable_node); |
485 void OnUpdateInspectorSetting(const std::string& key, | 512 void OnUpdateInspectorSetting(const std::string& key, |
486 const std::string& value); | 513 const std::string& value); |
487 void OnClosePageACK(); | 514 void OnClosePageACK(); |
| 515 void OnAccessibilityEvents( |
| 516 const std::vector<AccessibilityHostMsg_EventParams>& params); |
| 517 void OnAccessibilityLocationChanges( |
| 518 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params); |
488 void OnDidZoomURL(double zoom_level, const GURL& url); | 519 void OnDidZoomURL(double zoom_level, const GURL& url); |
489 void OnRunFileChooser(const FileChooserParams& params); | 520 void OnRunFileChooser(const FileChooserParams& params); |
490 void OnFocusedNodeTouched(bool editable); | 521 void OnFocusedNodeTouched(bool editable); |
491 | 522 |
492 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 523 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
493 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 524 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
494 void OnHidePopup(); | 525 void OnHidePopup(); |
495 #endif | 526 #endif |
496 | 527 |
497 private: | 528 private: |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. | 601 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. |
571 bool is_waiting_for_beforeunload_ack_; | 602 bool is_waiting_for_beforeunload_ack_; |
572 | 603 |
573 // Valid only when is_waiting_for_beforeunload_ack_ or | 604 // Valid only when is_waiting_for_beforeunload_ack_ or |
574 // IsWaitingForUnloadACK is true. This tells us if the unload request | 605 // IsWaitingForUnloadACK is true. This tells us if the unload request |
575 // is for closing the entire tab ( = false), or only this RenderViewHost in | 606 // is for closing the entire tab ( = false), or only this RenderViewHost in |
576 // the case of a cross-site transition ( = true). | 607 // the case of a cross-site transition ( = true). |
577 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. | 608 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. |
578 bool unload_ack_is_for_cross_site_transition_; | 609 bool unload_ack_is_for_cross_site_transition_; |
579 | 610 |
| 611 // Accessibility callback for testing. |
| 612 base::Callback<void(ui::AXEvent, int)> accessibility_testing_callback_; |
| 613 |
| 614 // The most recently received accessibility tree - for testing only. |
| 615 scoped_ptr<ui::AXTree> ax_tree_; |
| 616 |
580 // True if the render view can be shut down suddenly. | 617 // True if the render view can be shut down suddenly. |
581 bool sudden_termination_allowed_; | 618 bool sudden_termination_allowed_; |
582 | 619 |
583 // The termination status of the last render view that terminated. | 620 // The termination status of the last render view that terminated. |
584 base::TerminationStatus render_view_termination_status_; | 621 base::TerminationStatus render_view_termination_status_; |
585 | 622 |
586 // Set to true if we requested the on screen keyboard to be displayed. | 623 // Set to true if we requested the on screen keyboard to be displayed. |
587 bool virtual_keyboard_requested_; | 624 bool virtual_keyboard_requested_; |
588 | 625 |
589 #if defined(ENABLE_BROWSER_CDMS) | 626 #if defined(ENABLE_BROWSER_CDMS) |
(...skipping 20 matching lines...) Expand all Loading... |
610 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 647 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
611 }; | 648 }; |
612 | 649 |
613 #if defined(COMPILER_MSVC) | 650 #if defined(COMPILER_MSVC) |
614 #pragma warning(pop) | 651 #pragma warning(pop) |
615 #endif | 652 #endif |
616 | 653 |
617 } // namespace content | 654 } // namespace content |
618 | 655 |
619 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 656 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
OLD | NEW |