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