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