| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_view_host.h" | 5 #include "chrome/browser/renderer_host/render_view_host.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) | 887 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) |
| 888 IPC_MESSAGE_HANDLER(ViewHostMsg_WebDatabaseAccessed, OnWebDatabaseAccessed) | 888 IPC_MESSAGE_HANDLER(ViewHostMsg_WebDatabaseAccessed, OnWebDatabaseAccessed) |
| 889 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnMsgFocusedNodeChanged) | 889 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnMsgFocusedNodeChanged) |
| 890 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) | 890 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) |
| 891 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSuggestResult, OnSetSuggestResult) | 891 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSuggestResult, OnSetSuggestResult) |
| 892 IPC_MESSAGE_HANDLER(ViewHostMsg_DetectedPhishingSite, | 892 IPC_MESSAGE_HANDLER(ViewHostMsg_DetectedPhishingSite, |
| 893 OnDetectedPhishingSite) | 893 OnDetectedPhishingSite) |
| 894 IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse) | 894 IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse) |
| 895 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateContentRestrictions, | 895 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateContentRestrictions, |
| 896 OnUpdateContentRestrictions) | 896 OnUpdateContentRestrictions) |
| 897 #if defined(OS_MACOSX) |
| 898 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnMsgShowPopup) |
| 899 #endif |
| 897 // Have the super handle all other messages. | 900 // Have the super handle all other messages. |
| 898 IPC_MESSAGE_UNHANDLED(RenderWidgetHost::OnMessageReceived(msg)) | 901 IPC_MESSAGE_UNHANDLED(RenderWidgetHost::OnMessageReceived(msg)) |
| 899 IPC_END_MESSAGE_MAP_EX() | 902 IPC_END_MESSAGE_MAP_EX() |
| 900 | 903 |
| 901 if (!msg_is_ok) { | 904 if (!msg_is_ok) { |
| 902 // The message had a handler, but its de-serialization failed. | 905 // The message had a handler, but its de-serialization failed. |
| 903 // Kill the renderer. | 906 // Kill the renderer. |
| 904 process()->ReceivedBadMessage(msg.type()); | 907 process()->ReceivedBadMessage(msg.type()); |
| 905 } | 908 } |
| 906 } | 909 } |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2006 | 2009 |
| 2007 void RenderViewHost::SendContentSettings(const GURL& url, | 2010 void RenderViewHost::SendContentSettings(const GURL& url, |
| 2008 const ContentSettings& settings) { | 2011 const ContentSettings& settings) { |
| 2009 Send(new ViewMsg_SetContentSettingsForCurrentURL(url, settings)); | 2012 Send(new ViewMsg_SetContentSettingsForCurrentURL(url, settings)); |
| 2010 } | 2013 } |
| 2011 | 2014 |
| 2012 void RenderViewHost::EnablePreferredSizeChangedMode(int flags) { | 2015 void RenderViewHost::EnablePreferredSizeChangedMode(int flags) { |
| 2013 Send(new ViewMsg_EnablePreferredSizeChangedMode(routing_id(), flags)); | 2016 Send(new ViewMsg_EnablePreferredSizeChangedMode(routing_id(), flags)); |
| 2014 } | 2017 } |
| 2015 | 2018 |
| 2019 #if defined(OS_MACOSX) |
| 2020 void RenderViewHost::DidSelectPopupMenuItem(int selected_index) { |
| 2021 Send(new ViewMsg_SelectPopupMenuItem(routing_id(), selected_index)); |
| 2022 } |
| 2023 |
| 2024 void RenderViewHost::DidCancelPopupMenu() { |
| 2025 Send(new ViewMsg_SelectPopupMenuItem(routing_id(), -1)); |
| 2026 } |
| 2027 #endif |
| 2028 |
| 2016 void RenderViewHost::OnExtensionPostMessage( | 2029 void RenderViewHost::OnExtensionPostMessage( |
| 2017 int port_id, const std::string& message) { | 2030 int port_id, const std::string& message) { |
| 2018 if (process()->profile()->GetExtensionMessageService()) { | 2031 if (process()->profile()->GetExtensionMessageService()) { |
| 2019 process()->profile()->GetExtensionMessageService()-> | 2032 process()->profile()->GetExtensionMessageService()-> |
| 2020 PostMessageFromRenderer(port_id, message); | 2033 PostMessageFromRenderer(port_id, message); |
| 2021 } | 2034 } |
| 2022 } | 2035 } |
| 2023 | 2036 |
| 2024 void RenderViewHost::OnAccessibilityNotifications( | 2037 void RenderViewHost::OnAccessibilityNotifications( |
| 2025 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { | 2038 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2136 std::pair<int, Value*> details(id, result_value.get()); | 2149 std::pair<int, Value*> details(id, result_value.get()); |
| 2137 NotificationService::current()->Notify( | 2150 NotificationService::current()->Notify( |
| 2138 NotificationType::EXECUTE_JAVASCRIPT_RESULT, | 2151 NotificationType::EXECUTE_JAVASCRIPT_RESULT, |
| 2139 Source<RenderViewHost>(this), | 2152 Source<RenderViewHost>(this), |
| 2140 Details<std::pair<int, Value*> >(&details)); | 2153 Details<std::pair<int, Value*> >(&details)); |
| 2141 } | 2154 } |
| 2142 | 2155 |
| 2143 void RenderViewHost::OnUpdateContentRestrictions(int restrictions) { | 2156 void RenderViewHost::OnUpdateContentRestrictions(int restrictions) { |
| 2144 delegate_->UpdateContentRestrictions(restrictions); | 2157 delegate_->UpdateContentRestrictions(restrictions); |
| 2145 } | 2158 } |
| 2159 |
| 2160 #if defined(OS_MACOSX) |
| 2161 void RenderViewHost::OnMsgShowPopup( |
| 2162 const ViewHostMsg_ShowPopup_Params& params) { |
| 2163 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); |
| 2164 if (view) { |
| 2165 view->ShowPopupMenu(params.bounds, |
| 2166 params.item_height, |
| 2167 params.item_font_size, |
| 2168 params.selected_item, |
| 2169 params.popup_items, |
| 2170 params.right_aligned); |
| 2171 } |
| 2172 } |
| 2173 #endif |
| OLD | NEW |