| 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/javascript_message_type.h" | |
| 23 #include "content/public/common/window_container_type.h" | 22 #include "content/public/common/window_container_type.h" |
| 24 #include "net/base/load_states.h" | 23 #include "net/base/load_states.h" |
| 25 #include "third_party/WebKit/public/web/WebAXEnums.h" | 24 #include "third_party/WebKit/public/web/WebAXEnums.h" |
| 26 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 25 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
| 27 #include "third_party/WebKit/public/web/WebPopupType.h" | 26 #include "third_party/WebKit/public/web/WebPopupType.h" |
| 28 #include "third_party/WebKit/public/web/WebTextDirection.h" | 27 #include "third_party/WebKit/public/web/WebTextDirection.h" |
| 29 #include "third_party/skia/include/core/SkColor.h" | 28 #include "third_party/skia/include/core/SkColor.h" |
| 30 #include "ui/accessibility/ax_node_data.h" | 29 #include "ui/accessibility/ax_node_data.h" |
| 31 #include "ui/base/window_open_disposition.h" | 30 #include "ui/base/window_open_disposition.h" |
| 32 | 31 |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 // Cleared when we hear the response and start to swap out the old | 334 // Cleared when we hear the response and start to swap out the old |
| 336 // RenderViewHost, or if we hear a commit here without a network request. | 335 // RenderViewHost, or if we hear a commit here without a network request. |
| 337 bool HasPendingCrossSiteRequest(); | 336 bool HasPendingCrossSiteRequest(); |
| 338 | 337 |
| 339 // Sets whether this RenderViewHost has an outstanding cross-site request, | 338 // Sets whether this RenderViewHost has an outstanding cross-site request, |
| 340 // for which another renderer will need to run an onunload event handler. | 339 // for which another renderer will need to run an onunload event handler. |
| 341 // This is called before the first navigation event for this RenderViewHost, | 340 // This is called before the first navigation event for this RenderViewHost, |
| 342 // and cleared when we hear the response or commit. | 341 // and cleared when we hear the response or commit. |
| 343 void SetHasPendingCrossSiteRequest(bool has_pending_request); | 342 void SetHasPendingCrossSiteRequest(bool has_pending_request); |
| 344 | 343 |
| 345 // Notifies the RenderView that the JavaScript message that was shown was | |
| 346 // closed by the user. | |
| 347 void JavaScriptDialogClosed(IPC::Message* reply_msg, | |
| 348 bool success, | |
| 349 const base::string16& user_input); | |
| 350 | |
| 351 // Tells the renderer view to focus the first (last if reverse is true) node. | 344 // Tells the renderer view to focus the first (last if reverse is true) node. |
| 352 void SetInitialFocus(bool reverse); | 345 void SetInitialFocus(bool reverse); |
| 353 | 346 |
| 354 // Get html data by serializing all frames of current page with lists | 347 // Get html data by serializing all frames of current page with lists |
| 355 // which contain all resource links that have local copy. | 348 // which contain all resource links that have local copy. |
| 356 // The parameter links contain original URLs of all saved links. | 349 // The parameter links contain original URLs of all saved links. |
| 357 // The parameter local_paths contain corresponding local file paths of | 350 // The parameter local_paths contain corresponding local file paths of |
| 358 // all saved links, which matched with vector:links one by one. | 351 // all saved links, which matched with vector:links one by one. |
| 359 // The parameter local_directory_name is relative path of directory which | 352 // The parameter local_directory_name is relative path of directory which |
| 360 // contain all saved auxiliary files included all sub frames and resouces. | 353 // contain all saved auxiliary files included all sub frames and resouces. |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 bool has_vertical_scrollbar); | 517 bool has_vertical_scrollbar); |
| 525 void OnDidChangeScrollOffsetPinningForMainFrame(bool is_pinned_to_left, | 518 void OnDidChangeScrollOffsetPinningForMainFrame(bool is_pinned_to_left, |
| 526 bool is_pinned_to_right); | 519 bool is_pinned_to_right); |
| 527 void OnDidChangeNumWheelEvents(int count); | 520 void OnDidChangeNumWheelEvents(int count); |
| 528 #if defined(OS_ANDROID) | 521 #if defined(OS_ANDROID) |
| 529 void OnSelectionRootBoundsChanged(const gfx::Rect& bounds); | 522 void OnSelectionRootBoundsChanged(const gfx::Rect& bounds); |
| 530 #endif | 523 #endif |
| 531 void OnPasteFromSelectionClipboard(); | 524 void OnPasteFromSelectionClipboard(); |
| 532 void OnRouteCloseEvent(); | 525 void OnRouteCloseEvent(); |
| 533 void OnRouteMessageEvent(const ViewMsg_PostMessage_Params& params); | 526 void OnRouteMessageEvent(const ViewMsg_PostMessage_Params& params); |
| 534 void OnRunJavaScriptMessage(const base::string16& message, | |
| 535 const base::string16& default_prompt, | |
| 536 const GURL& frame_url, | |
| 537 JavaScriptMessageType type, | |
| 538 IPC::Message* reply_msg); | |
| 539 void OnRunBeforeUnloadConfirm(const GURL& frame_url, | |
| 540 const base::string16& message, | |
| 541 bool is_reload, | |
| 542 IPC::Message* reply_msg); | |
| 543 void OnStartDragging(const DropData& drop_data, | 527 void OnStartDragging(const DropData& drop_data, |
| 544 blink::WebDragOperationsMask operations_allowed, | 528 blink::WebDragOperationsMask operations_allowed, |
| 545 const SkBitmap& bitmap, | 529 const SkBitmap& bitmap, |
| 546 const gfx::Vector2d& bitmap_offset_in_dip, | 530 const gfx::Vector2d& bitmap_offset_in_dip, |
| 547 const DragEventSourceInfo& event_info); | 531 const DragEventSourceInfo& event_info); |
| 548 void OnUpdateDragCursor(blink::WebDragOperation drag_operation); | 532 void OnUpdateDragCursor(blink::WebDragOperation drag_operation); |
| 549 void OnTargetDropACK(); | 533 void OnTargetDropACK(); |
| 550 void OnTakeFocus(bool reverse); | 534 void OnTakeFocus(bool reverse); |
| 551 void OnFocusedNodeChanged(bool is_editable_node); | 535 void OnFocusedNodeChanged(bool is_editable_node); |
| 552 void OnUpdateInspectorSetting(const std::string& key, | 536 void OnUpdateInspectorSetting(const std::string& key, |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. | 637 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. |
| 654 bool is_waiting_for_beforeunload_ack_; | 638 bool is_waiting_for_beforeunload_ack_; |
| 655 | 639 |
| 656 // Valid only when is_waiting_for_beforeunload_ack_ or | 640 // Valid only when is_waiting_for_beforeunload_ack_ or |
| 657 // IsWaitingForUnloadACK is true. This tells us if the unload request | 641 // IsWaitingForUnloadACK is true. This tells us if the unload request |
| 658 // is for closing the entire tab ( = false), or only this RenderViewHost in | 642 // is for closing the entire tab ( = false), or only this RenderViewHost in |
| 659 // the case of a cross-site transition ( = true). | 643 // the case of a cross-site transition ( = true). |
| 660 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. | 644 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. |
| 661 bool unload_ack_is_for_cross_site_transition_; | 645 bool unload_ack_is_for_cross_site_transition_; |
| 662 | 646 |
| 663 bool are_javascript_messages_suppressed_; | |
| 664 | |
| 665 // Accessibility callback for testing. | 647 // Accessibility callback for testing. |
| 666 base::Callback<void(ui::AXEvent)> accessibility_testing_callback_; | 648 base::Callback<void(ui::AXEvent)> accessibility_testing_callback_; |
| 667 | 649 |
| 668 // The most recently received accessibility tree - for testing only. | 650 // The most recently received accessibility tree - for testing only. |
| 669 scoped_ptr<ui::AXTree> ax_tree_; | 651 scoped_ptr<ui::AXTree> ax_tree_; |
| 670 | 652 |
| 671 // True if the render view can be shut down suddenly. | 653 // True if the render view can be shut down suddenly. |
| 672 bool sudden_termination_allowed_; | 654 bool sudden_termination_allowed_; |
| 673 | 655 |
| 674 // The termination status of the last render view that terminated. | 656 // The termination status of the last render view that terminated. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 698 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 680 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
| 699 }; | 681 }; |
| 700 | 682 |
| 701 #if defined(COMPILER_MSVC) | 683 #if defined(COMPILER_MSVC) |
| 702 #pragma warning(pop) | 684 #pragma warning(pop) |
| 703 #endif | 685 #endif |
| 704 | 686 |
| 705 } // namespace content | 687 } // namespace content |
| 706 | 688 |
| 707 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 689 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
| OLD | NEW |