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/WebKit/public/web/WebTextDirection.h" | 27 #include "third_party/WebKit/public/web/WebTextDirection.h" |
28 #include "third_party/skia/include/core/SkColor.h" | 28 #include "third_party/skia/include/core/SkColor.h" |
29 #include "ui/accessibility/ax_node_data.h" | |
30 #include "ui/base/window_open_disposition.h" | 29 #include "ui/base/window_open_disposition.h" |
31 | 30 |
32 class SkBitmap; | 31 class SkBitmap; |
33 class FrameMsg_Navigate; | 32 class FrameMsg_Navigate; |
34 struct AccessibilityHostMsg_EventParams; | |
35 struct AccessibilityHostMsg_LocationChangeParams; | |
36 struct MediaPlayerAction; | 33 struct MediaPlayerAction; |
37 struct ViewHostMsg_CreateWindow_Params; | 34 struct ViewHostMsg_CreateWindow_Params; |
38 struct ViewHostMsg_ShowPopup_Params; | 35 struct ViewHostMsg_ShowPopup_Params; |
39 struct FrameMsg_Navigate_Params; | 36 struct FrameMsg_Navigate_Params; |
40 struct ViewMsg_PostMessage_Params; | 37 struct ViewMsg_PostMessage_Params; |
41 | 38 |
42 namespace base { | 39 namespace base { |
43 class ListValue; | 40 class ListValue; |
44 } | 41 } |
45 | 42 |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 // User rotated the screen. Calls the "onorientationchange" Javascript hook. | 395 // User rotated the screen. Calls the "onorientationchange" Javascript hook. |
399 void SendOrientationChangeEvent(int orientation); | 396 void SendOrientationChangeEvent(int orientation); |
400 | 397 |
401 int main_frame_routing_id() const { | 398 int main_frame_routing_id() const { |
402 return main_frame_routing_id_; | 399 return main_frame_routing_id_; |
403 } | 400 } |
404 | 401 |
405 // Set the opener to null in the renderer process. | 402 // Set the opener to null in the renderer process. |
406 void DisownOpener(); | 403 void DisownOpener(); |
407 | 404 |
408 // Turn on accessibility testing. The given callback will be run | |
409 // every time an accessibility notification is received from the | |
410 // renderer process, and the accessibility tree it sent can be | |
411 // retrieved using accessibility_tree_for_testing(). | |
412 void SetAccessibilityCallbackForTesting( | |
413 const base::Callback<void(ui::AXEvent)>& callback); | |
414 | |
415 // Only valid if SetAccessibilityCallbackForTesting was called and | |
416 // the callback was run at least once. Returns a snapshot of the | |
417 // accessibility tree received from the renderer as of the last time | |
418 // an accessibility notification was received. | |
419 const ui::AXTree& ax_tree_for_testing() { | |
420 CHECK(ax_tree_.get()); | |
421 return *ax_tree_.get(); | |
422 } | |
423 | |
424 // Set accessibility callbacks. | |
425 void SetAccessibilityLayoutCompleteCallbackForTesting( | |
426 const base::Closure& callback); | |
427 void SetAccessibilityLoadCompleteCallbackForTesting( | |
428 const base::Closure& callback); | |
429 void SetAccessibilityOtherCallbackForTesting( | |
430 const base::Closure& callback); | |
431 | |
432 bool is_waiting_for_beforeunload_ack() { | 405 bool is_waiting_for_beforeunload_ack() { |
433 return is_waiting_for_beforeunload_ack_; | 406 return is_waiting_for_beforeunload_ack_; |
434 } | 407 } |
435 | 408 |
436 // Whether the RVH is waiting for the unload ack from the renderer. | 409 // Whether the RVH is waiting for the unload ack from the renderer. |
437 bool IsWaitingForUnloadACK() const; | 410 bool IsWaitingForUnloadACK() const; |
438 | 411 |
439 // Update the FrameTree to use this RenderViewHost's main frame | 412 // Update the FrameTree to use this RenderViewHost's main frame |
440 // RenderFrameHost. Called when the RenderViewHost is committed. | 413 // RenderFrameHost. Called when the RenderViewHost is committed. |
441 // | 414 // |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 const SkBitmap& bitmap, | 482 const SkBitmap& bitmap, |
510 const gfx::Vector2d& bitmap_offset_in_dip, | 483 const gfx::Vector2d& bitmap_offset_in_dip, |
511 const DragEventSourceInfo& event_info); | 484 const DragEventSourceInfo& event_info); |
512 void OnUpdateDragCursor(blink::WebDragOperation drag_operation); | 485 void OnUpdateDragCursor(blink::WebDragOperation drag_operation); |
513 void OnTargetDropACK(); | 486 void OnTargetDropACK(); |
514 void OnTakeFocus(bool reverse); | 487 void OnTakeFocus(bool reverse); |
515 void OnFocusedNodeChanged(bool is_editable_node); | 488 void OnFocusedNodeChanged(bool is_editable_node); |
516 void OnUpdateInspectorSetting(const std::string& key, | 489 void OnUpdateInspectorSetting(const std::string& key, |
517 const std::string& value); | 490 const std::string& value); |
518 void OnClosePageACK(); | 491 void OnClosePageACK(); |
519 void OnAccessibilityEvents( | |
520 const std::vector<AccessibilityHostMsg_EventParams>& params); | |
521 void OnAccessibilityLocationChanges( | |
522 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params); | |
523 void OnDidZoomURL(double zoom_level, bool remember, const GURL& url); | 492 void OnDidZoomURL(double zoom_level, bool remember, const GURL& url); |
524 void OnRunFileChooser(const FileChooserParams& params); | 493 void OnRunFileChooser(const FileChooserParams& params); |
525 void OnFocusedNodeTouched(bool editable); | 494 void OnFocusedNodeTouched(bool editable); |
526 | 495 |
527 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 496 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
528 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 497 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
529 void OnHidePopup(); | 498 void OnHidePopup(); |
530 #endif | 499 #endif |
531 | 500 |
532 private: | 501 private: |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. | 574 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. |
606 bool is_waiting_for_beforeunload_ack_; | 575 bool is_waiting_for_beforeunload_ack_; |
607 | 576 |
608 // Valid only when is_waiting_for_beforeunload_ack_ or | 577 // Valid only when is_waiting_for_beforeunload_ack_ or |
609 // IsWaitingForUnloadACK is true. This tells us if the unload request | 578 // IsWaitingForUnloadACK is true. This tells us if the unload request |
610 // is for closing the entire tab ( = false), or only this RenderViewHost in | 579 // is for closing the entire tab ( = false), or only this RenderViewHost in |
611 // the case of a cross-site transition ( = true). | 580 // the case of a cross-site transition ( = true). |
612 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. | 581 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. |
613 bool unload_ack_is_for_cross_site_transition_; | 582 bool unload_ack_is_for_cross_site_transition_; |
614 | 583 |
615 // Accessibility callback for testing. | |
616 base::Callback<void(ui::AXEvent)> accessibility_testing_callback_; | |
617 | |
618 // The most recently received accessibility tree - for testing only. | |
619 scoped_ptr<ui::AXTree> ax_tree_; | |
620 | |
621 // True if the render view can be shut down suddenly. | 584 // True if the render view can be shut down suddenly. |
622 bool sudden_termination_allowed_; | 585 bool sudden_termination_allowed_; |
623 | 586 |
624 // The termination status of the last render view that terminated. | 587 // The termination status of the last render view that terminated. |
625 base::TerminationStatus render_view_termination_status_; | 588 base::TerminationStatus render_view_termination_status_; |
626 | 589 |
627 // Set to true if we requested the on screen keyboard to be displayed. | 590 // Set to true if we requested the on screen keyboard to be displayed. |
628 bool virtual_keyboard_requested_; | 591 bool virtual_keyboard_requested_; |
629 | 592 |
630 #if defined(OS_ANDROID) | 593 #if defined(OS_ANDROID) |
(...skipping 17 matching lines...) Expand all Loading... |
648 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 611 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
649 }; | 612 }; |
650 | 613 |
651 #if defined(COMPILER_MSVC) | 614 #if defined(COMPILER_MSVC) |
652 #pragma warning(pop) | 615 #pragma warning(pop) |
653 #endif | 616 #endif |
654 | 617 |
655 } // namespace content | 618 } // namespace content |
656 | 619 |
657 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 620 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
OLD | NEW |