| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 OnAccessibilityChildFrameHitTestResult) | 577 OnAccessibilityChildFrameHitTestResult) |
| 578 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_SnapshotResponse, | 578 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_SnapshotResponse, |
| 579 OnAccessibilitySnapshotResponse) | 579 OnAccessibilitySnapshotResponse) |
| 580 IPC_MESSAGE_HANDLER(FrameHostMsg_ToggleFullscreen, OnToggleFullscreen) | 580 IPC_MESSAGE_HANDLER(FrameHostMsg_ToggleFullscreen, OnToggleFullscreen) |
| 581 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartLoading, OnDidStartLoading) | 581 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartLoading, OnDidStartLoading) |
| 582 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStopLoading, OnDidStopLoading) | 582 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStopLoading, OnDidStopLoading) |
| 583 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeLoadProgress, | 583 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeLoadProgress, |
| 584 OnDidChangeLoadProgress) | 584 OnDidChangeLoadProgress) |
| 585 IPC_MESSAGE_HANDLER(FrameHostMsg_SerializeAsMHTMLResponse, | 585 IPC_MESSAGE_HANDLER(FrameHostMsg_SerializeAsMHTMLResponse, |
| 586 OnSerializeAsMHTMLResponse) | 586 OnSerializeAsMHTMLResponse) |
| 587 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 587 #if defined(USE_EXTERNAL_POPUP_MENU) |
| 588 IPC_MESSAGE_HANDLER(FrameHostMsg_ShowPopup, OnShowPopup) | 588 IPC_MESSAGE_HANDLER(FrameHostMsg_ShowPopup, OnShowPopup) |
| 589 IPC_MESSAGE_HANDLER(FrameHostMsg_HidePopup, OnHidePopup) | 589 IPC_MESSAGE_HANDLER(FrameHostMsg_HidePopup, OnHidePopup) |
| 590 #endif | 590 #endif |
| 591 IPC_END_MESSAGE_MAP() | 591 IPC_END_MESSAGE_MAP() |
| 592 | 592 |
| 593 // No further actions here, since we may have been deleted. | 593 // No further actions here, since we may have been deleted. |
| 594 return handled; | 594 return handled; |
| 595 } | 595 } |
| 596 | 596 |
| 597 void RenderFrameHostImpl::AccessibilitySetFocus(int object_id) { | 597 void RenderFrameHostImpl::AccessibilitySetFocus(int object_id) { |
| (...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1921 } | 1921 } |
| 1922 | 1922 |
| 1923 void RenderFrameHostImpl::OnSerializeAsMHTMLResponse( | 1923 void RenderFrameHostImpl::OnSerializeAsMHTMLResponse( |
| 1924 int job_id, | 1924 int job_id, |
| 1925 bool success, | 1925 bool success, |
| 1926 const std::set<std::string>& digests_of_uris_of_serialized_resources) { | 1926 const std::set<std::string>& digests_of_uris_of_serialized_resources) { |
| 1927 MHTMLGenerationManager::GetInstance()->OnSerializeAsMHTMLResponse( | 1927 MHTMLGenerationManager::GetInstance()->OnSerializeAsMHTMLResponse( |
| 1928 this, job_id, success, digests_of_uris_of_serialized_resources); | 1928 this, job_id, success, digests_of_uris_of_serialized_resources); |
| 1929 } | 1929 } |
| 1930 | 1930 |
| 1931 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 1931 #if defined(USE_EXTERNAL_POPUP_MENU) |
| 1932 void RenderFrameHostImpl::OnShowPopup( | 1932 void RenderFrameHostImpl::OnShowPopup( |
| 1933 const FrameHostMsg_ShowPopup_Params& params) { | 1933 const FrameHostMsg_ShowPopup_Params& params) { |
| 1934 RenderViewHostDelegateView* view = | 1934 RenderViewHostDelegateView* view = |
| 1935 render_view_host_->delegate_->GetDelegateView(); | 1935 render_view_host_->delegate_->GetDelegateView(); |
| 1936 if (view) { | 1936 if (view) { |
| 1937 gfx::Point original_point(params.bounds.x(), params.bounds.y()); | 1937 gfx::Point original_point(params.bounds.x(), params.bounds.y()); |
| 1938 gfx::Point transformed_point = | 1938 gfx::Point transformed_point = |
| 1939 static_cast<RenderWidgetHostViewBase*>(GetView()) | 1939 static_cast<RenderWidgetHostViewBase*>(GetView()) |
| 1940 ->TransformPointToRootCoordSpace(original_point); | 1940 ->TransformPointToRootCoordSpace(original_point); |
| 1941 gfx::Rect transformed_bounds(transformed_point.x(), transformed_point.y(), | 1941 gfx::Rect transformed_bounds(transformed_point.x(), transformed_point.y(), |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2611 | 2611 |
| 2612 return is_live; | 2612 return is_live; |
| 2613 } | 2613 } |
| 2614 | 2614 |
| 2615 int RenderFrameHostImpl::GetProxyCount() { | 2615 int RenderFrameHostImpl::GetProxyCount() { |
| 2616 if (this != frame_tree_node_->current_frame_host()) | 2616 if (this != frame_tree_node_->current_frame_host()) |
| 2617 return 0; | 2617 return 0; |
| 2618 return frame_tree_node_->render_manager()->GetProxyCount(); | 2618 return frame_tree_node_->render_manager()->GetProxyCount(); |
| 2619 } | 2619 } |
| 2620 | 2620 |
| 2621 #if defined(USE_EXTERNAL_POPUP_MENU) |
| 2621 #if defined(OS_MACOSX) | 2622 #if defined(OS_MACOSX) |
| 2622 | 2623 |
| 2623 void RenderFrameHostImpl::DidSelectPopupMenuItem(int selected_index) { | 2624 void RenderFrameHostImpl::DidSelectPopupMenuItem(int selected_index) { |
| 2624 Send(new FrameMsg_SelectPopupMenuItem(routing_id_, selected_index)); | 2625 Send(new FrameMsg_SelectPopupMenuItem(routing_id_, selected_index)); |
| 2625 } | 2626 } |
| 2626 | 2627 |
| 2627 void RenderFrameHostImpl::DidCancelPopupMenu() { | 2628 void RenderFrameHostImpl::DidCancelPopupMenu() { |
| 2628 Send(new FrameMsg_SelectPopupMenuItem(routing_id_, -1)); | 2629 Send(new FrameMsg_SelectPopupMenuItem(routing_id_, -1)); |
| 2629 } | 2630 } |
| 2630 | 2631 |
| 2631 #elif defined(OS_ANDROID) | 2632 #else |
| 2632 | 2633 |
| 2633 void RenderFrameHostImpl::DidSelectPopupMenuItems( | 2634 void RenderFrameHostImpl::DidSelectPopupMenuItems( |
| 2634 const std::vector<int>& selected_indices) { | 2635 const std::vector<int>& selected_indices) { |
| 2635 Send(new FrameMsg_SelectPopupMenuItems(routing_id_, false, selected_indices)); | 2636 Send(new FrameMsg_SelectPopupMenuItems(routing_id_, false, selected_indices)); |
| 2636 } | 2637 } |
| 2637 | 2638 |
| 2638 void RenderFrameHostImpl::DidCancelPopupMenu() { | 2639 void RenderFrameHostImpl::DidCancelPopupMenu() { |
| 2639 Send(new FrameMsg_SelectPopupMenuItems( | 2640 Send(new FrameMsg_SelectPopupMenuItems( |
| 2640 routing_id_, true, std::vector<int>())); | 2641 routing_id_, true, std::vector<int>())); |
| 2641 } | 2642 } |
| 2642 | 2643 |
| 2643 #endif | 2644 #endif |
| 2645 #endif |
| 2644 | 2646 |
| 2645 void RenderFrameHostImpl::SetNavigationsSuspended( | 2647 void RenderFrameHostImpl::SetNavigationsSuspended( |
| 2646 bool suspend, | 2648 bool suspend, |
| 2647 const base::TimeTicks& proceed_time) { | 2649 const base::TimeTicks& proceed_time) { |
| 2648 // This should only be called to toggle the state. | 2650 // This should only be called to toggle the state. |
| 2649 DCHECK(navigations_suspended_ != suspend); | 2651 DCHECK(navigations_suspended_ != suspend); |
| 2650 | 2652 |
| 2651 navigations_suspended_ = suspend; | 2653 navigations_suspended_ = suspend; |
| 2652 if (navigations_suspended_) { | 2654 if (navigations_suspended_) { |
| 2653 TRACE_EVENT_ASYNC_BEGIN0("navigation", | 2655 TRACE_EVENT_ASYNC_BEGIN0("navigation", |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2856 // handler after it's destroyed so it can't run after the RFHI is destroyed. | 2858 // handler after it's destroyed so it can't run after the RFHI is destroyed. |
| 2857 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 2859 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
| 2858 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 2860 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
| 2859 } | 2861 } |
| 2860 | 2862 |
| 2861 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 2863 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
| 2862 web_bluetooth_service_.reset(); | 2864 web_bluetooth_service_.reset(); |
| 2863 } | 2865 } |
| 2864 | 2866 |
| 2865 } // namespace content | 2867 } // namespace content |
| OLD | NEW |