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/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "base/process/kill.h" | 16 #include "base/process/kill.h" |
17 #include "content/browser/renderer_host/render_frame_host_impl.h" | 17 #include "content/browser/renderer_host/render_frame_host_impl.h" |
18 #include "content/browser/renderer_host/render_widget_host_impl.h" | 18 #include "content/browser/renderer_host/render_widget_host_impl.h" |
19 #include "content/browser/site_instance_impl.h" | 19 #include "content/browser/site_instance_impl.h" |
20 #include "content/common/accessibility_node_data.h" | 20 #include "content/common/accessibility_node_data.h" |
21 #include "content/common/accessibility_notification.h" | |
22 #include "content/common/drag_event_source_info.h" | 21 #include "content/common/drag_event_source_info.h" |
23 #include "content/public/browser/notification_observer.h" | 22 #include "content/public/browser/notification_observer.h" |
24 #include "content/public/browser/render_view_host.h" | 23 #include "content/public/browser/render_view_host.h" |
25 #include "content/public/common/javascript_message_type.h" | 24 #include "content/public/common/javascript_message_type.h" |
26 #include "content/public/common/window_container_type.h" | 25 #include "content/public/common/window_container_type.h" |
27 #include "net/base/load_states.h" | 26 #include "net/base/load_states.h" |
28 #include "third_party/skia/include/core/SkColor.h" | 27 #include "third_party/WebKit/public/web/WebAXEnums.h" |
29 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 28 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
30 #include "third_party/WebKit/public/web/WebPopupType.h" | 29 #include "third_party/WebKit/public/web/WebPopupType.h" |
31 #include "third_party/WebKit/public/web/WebTextDirection.h" | 30 #include "third_party/WebKit/public/web/WebTextDirection.h" |
| 31 #include "third_party/skia/include/core/SkColor.h" |
32 #include "ui/base/window_open_disposition.h" | 32 #include "ui/base/window_open_disposition.h" |
33 | 33 |
34 class SkBitmap; | 34 class SkBitmap; |
35 class ViewMsg_Navigate; | 35 class ViewMsg_Navigate; |
36 struct AccessibilityHostMsg_NotificationParams; | 36 struct AccessibilityHostMsg_EventParams; |
37 struct MediaPlayerAction; | 37 struct MediaPlayerAction; |
38 struct ViewHostMsg_CreateWindow_Params; | 38 struct ViewHostMsg_CreateWindow_Params; |
39 struct ViewHostMsg_DidFailProvisionalLoadWithError_Params; | 39 struct ViewHostMsg_DidFailProvisionalLoadWithError_Params; |
40 struct ViewHostMsg_OpenURL_Params; | 40 struct ViewHostMsg_OpenURL_Params; |
41 struct ViewHostMsg_SelectionBounds_Params; | 41 struct ViewHostMsg_SelectionBounds_Params; |
42 struct ViewHostMsg_ShowPopup_Params; | 42 struct ViewHostMsg_ShowPopup_Params; |
43 struct ViewMsg_Navigate_Params; | 43 struct ViewMsg_Navigate_Params; |
44 struct ViewMsg_PostMessage_Params; | 44 struct ViewMsg_PostMessage_Params; |
45 struct ViewMsg_StopFinding_Params; | 45 struct ViewMsg_StopFinding_Params; |
46 | 46 |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 } | 408 } |
409 | 409 |
410 // Set the opener to null in the renderer process. | 410 // Set the opener to null in the renderer process. |
411 void DisownOpener(); | 411 void DisownOpener(); |
412 | 412 |
413 // Turn on accessibility testing. The given callback will be run | 413 // Turn on accessibility testing. The given callback will be run |
414 // every time an accessibility notification is received from the | 414 // every time an accessibility notification is received from the |
415 // renderer process, and the accessibility tree it sent can be | 415 // renderer process, and the accessibility tree it sent can be |
416 // retrieved using accessibility_tree_for_testing(). | 416 // retrieved using accessibility_tree_for_testing(). |
417 void SetAccessibilityCallbackForTesting( | 417 void SetAccessibilityCallbackForTesting( |
418 const base::Callback<void(AccessibilityNotification)>& callback); | 418 const base::Callback<void(WebKit::WebAXEvent)>& callback); |
419 | 419 |
420 // Only valid if SetAccessibilityCallbackForTesting was called and | 420 // Only valid if SetAccessibilityCallbackForTesting was called and |
421 // the callback was run at least once. Returns a snapshot of the | 421 // the callback was run at least once. Returns a snapshot of the |
422 // accessibility tree received from the renderer as of the last time | 422 // accessibility tree received from the renderer as of the last time |
423 // a LoadComplete or LayoutComplete accessibility notification was received. | 423 // a LoadComplete or LayoutComplete accessibility notification was received. |
424 const AccessibilityNodeDataTreeNode& accessibility_tree_for_testing() { | 424 const AccessibilityNodeDataTreeNode& accessibility_tree_for_testing() { |
425 return accessibility_tree_; | 425 return accessibility_tree_; |
426 } | 426 } |
427 | 427 |
428 // Set accessibility callbacks. | 428 // Set accessibility callbacks. |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 int32 line_no, | 554 int32 line_no, |
555 const string16& source_id); | 555 const string16& source_id); |
556 void OnUpdateInspectorSetting(const std::string& key, | 556 void OnUpdateInspectorSetting(const std::string& key, |
557 const std::string& value); | 557 const std::string& value); |
558 void OnShouldCloseACK( | 558 void OnShouldCloseACK( |
559 bool proceed, | 559 bool proceed, |
560 const base::TimeTicks& renderer_before_unload_start_time, | 560 const base::TimeTicks& renderer_before_unload_start_time, |
561 const base::TimeTicks& renderer_before_unload_end_time); | 561 const base::TimeTicks& renderer_before_unload_end_time); |
562 void OnClosePageACK(); | 562 void OnClosePageACK(); |
563 void OnSwapOutACK(); | 563 void OnSwapOutACK(); |
564 void OnAccessibilityNotifications( | 564 void OnAccessibilityEvents( |
565 const std::vector<AccessibilityHostMsg_NotificationParams>& params); | 565 const std::vector<AccessibilityHostMsg_EventParams>& params); |
566 void OnScriptEvalResponse(int id, const base::ListValue& result); | 566 void OnScriptEvalResponse(int id, const base::ListValue& result); |
567 void OnDidZoomURL(double zoom_level, bool remember, const GURL& url); | 567 void OnDidZoomURL(double zoom_level, bool remember, const GURL& url); |
568 void OnRequestDesktopNotificationPermission(const GURL& origin, | 568 void OnRequestDesktopNotificationPermission(const GURL& origin, |
569 int callback_id); | 569 int callback_id); |
570 void OnShowDesktopNotification( | 570 void OnShowDesktopNotification( |
571 const ShowDesktopNotificationHostMsgParams& params); | 571 const ShowDesktopNotificationHostMsgParams& params); |
572 void OnCancelDesktopNotification(int notification_id); | 572 void OnCancelDesktopNotification(int notification_id); |
573 void OnRunFileChooser(const FileChooserParams& params); | 573 void OnRunFileChooser(const FileChooserParams& params); |
574 void OnDidAccessInitialDocument(); | 574 void OnDidAccessInitialDocument(); |
575 void OnDomOperationResponse(const std::string& json_string, | 575 void OnDomOperationResponse(const std::string& json_string, |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 bool unload_ack_is_for_cross_site_transition_; | 675 bool unload_ack_is_for_cross_site_transition_; |
676 | 676 |
677 bool are_javascript_messages_suppressed_; | 677 bool are_javascript_messages_suppressed_; |
678 | 678 |
679 // The mapping of pending javascript calls created by | 679 // The mapping of pending javascript calls created by |
680 // ExecuteJavascriptInWebFrameCallbackResult and their corresponding | 680 // ExecuteJavascriptInWebFrameCallbackResult and their corresponding |
681 // callbacks. | 681 // callbacks. |
682 std::map<int, JavascriptResultCallback> javascript_callbacks_; | 682 std::map<int, JavascriptResultCallback> javascript_callbacks_; |
683 | 683 |
684 // Accessibility callback for testing. | 684 // Accessibility callback for testing. |
685 base::Callback<void(AccessibilityNotification)> | 685 base::Callback<void(WebKit::WebAXEvent)> accessibility_testing_callback_; |
686 accessibility_testing_callback_; | |
687 | 686 |
688 // The most recently received accessibility tree - for testing only. | 687 // The most recently received accessibility tree - for testing only. |
689 AccessibilityNodeDataTreeNode accessibility_tree_; | 688 AccessibilityNodeDataTreeNode accessibility_tree_; |
690 | 689 |
691 // True if the render view can be shut down suddenly. | 690 // True if the render view can be shut down suddenly. |
692 bool sudden_termination_allowed_; | 691 bool sudden_termination_allowed_; |
693 | 692 |
694 // The termination status of the last render view that terminated. | 693 // The termination status of the last render view that terminated. |
695 base::TerminationStatus render_view_termination_status_; | 694 base::TerminationStatus render_view_termination_status_; |
696 | 695 |
(...skipping 12 matching lines...) Expand all Loading... |
709 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 708 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
710 }; | 709 }; |
711 | 710 |
712 #if defined(COMPILER_MSVC) | 711 #if defined(COMPILER_MSVC) |
713 #pragma warning(pop) | 712 #pragma warning(pop) |
714 #endif | 713 #endif |
715 | 714 |
716 } // namespace content | 715 } // namespace content |
717 | 716 |
718 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 717 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
OLD | NEW |