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 #include "content/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse) | 1135 IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse) |
1136 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) | 1136 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) |
1137 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_RequestPermission, | 1137 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_RequestPermission, |
1138 OnRequestDesktopNotificationPermission) | 1138 OnRequestDesktopNotificationPermission) |
1139 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Show, | 1139 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Show, |
1140 OnShowDesktopNotification) | 1140 OnShowDesktopNotification) |
1141 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Cancel, | 1141 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Cancel, |
1142 OnCancelDesktopNotification) | 1142 OnCancelDesktopNotification) |
1143 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 1143 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
1144 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnShowPopup) | 1144 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnShowPopup) |
| 1145 IPC_MESSAGE_HANDLER(ViewHostMsg_HidePopup, OnHidePopup) |
1145 #endif | 1146 #endif |
1146 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser) | 1147 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser) |
1147 IPC_MESSAGE_HANDLER(ViewHostMsg_DidAccessInitialDocument, | 1148 IPC_MESSAGE_HANDLER(ViewHostMsg_DidAccessInitialDocument, |
1148 OnDidAccessInitialDocument) | 1149 OnDidAccessInitialDocument) |
1149 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) | 1150 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) |
1150 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_LocationChanges, | 1151 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_LocationChanges, |
1151 OnAccessibilityLocationChanges) | 1152 OnAccessibilityLocationChanges) |
1152 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched) | 1153 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched) |
1153 // Have the super handle all other messages. | 1154 // Have the super handle all other messages. |
1154 IPC_MESSAGE_UNHANDLED( | 1155 IPC_MESSAGE_UNHANDLED( |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1889 if (view) { | 1890 if (view) { |
1890 view->ShowPopupMenu(params.bounds, | 1891 view->ShowPopupMenu(params.bounds, |
1891 params.item_height, | 1892 params.item_height, |
1892 params.item_font_size, | 1893 params.item_font_size, |
1893 params.selected_item, | 1894 params.selected_item, |
1894 params.popup_items, | 1895 params.popup_items, |
1895 params.right_aligned, | 1896 params.right_aligned, |
1896 params.allow_multiple_selection); | 1897 params.allow_multiple_selection); |
1897 } | 1898 } |
1898 } | 1899 } |
| 1900 |
| 1901 void RenderViewHostImpl::OnHidePopup() { |
| 1902 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); |
| 1903 if (view) |
| 1904 view->HidePopupMenu(); |
| 1905 } |
1899 #endif | 1906 #endif |
1900 | 1907 |
1901 void RenderViewHostImpl::SetState(RenderViewHostImplState rvh_state) { | 1908 void RenderViewHostImpl::SetState(RenderViewHostImplState rvh_state) { |
1902 // We update the number of RenderViews in a SiteInstance when the | 1909 // We update the number of RenderViews in a SiteInstance when the |
1903 // swapped out status of this RenderView gets flipped to/from live. | 1910 // swapped out status of this RenderView gets flipped to/from live. |
1904 if (!IsRVHStateActive(rvh_state_) && IsRVHStateActive(rvh_state)) | 1911 if (!IsRVHStateActive(rvh_state_) && IsRVHStateActive(rvh_state)) |
1905 instance_->increment_active_view_count(); | 1912 instance_->increment_active_view_count(); |
1906 else if (IsRVHStateActive(rvh_state_) && !IsRVHStateActive(rvh_state)) | 1913 else if (IsRVHStateActive(rvh_state_) && !IsRVHStateActive(rvh_state)) |
1907 instance_->decrement_active_view_count(); | 1914 instance_->decrement_active_view_count(); |
1908 | 1915 |
(...skipping 24 matching lines...) Expand all Loading... |
1933 return true; | 1940 return true; |
1934 } | 1941 } |
1935 | 1942 |
1936 void RenderViewHostImpl::AttachToFrameTree() { | 1943 void RenderViewHostImpl::AttachToFrameTree() { |
1937 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1944 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1938 | 1945 |
1939 frame_tree->ResetForMainFrameSwap(); | 1946 frame_tree->ResetForMainFrameSwap(); |
1940 } | 1947 } |
1941 | 1948 |
1942 } // namespace content | 1949 } // namespace content |
OLD | NEW |