OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionPostMessage, | 800 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionPostMessage, |
801 OnExtensionPostMessage) | 801 OnExtensionPostMessage) |
802 IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityNotifications, | 802 IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityNotifications, |
803 OnAccessibilityNotifications) | 803 OnAccessibilityNotifications) |
804 IPC_MESSAGE_HANDLER(ViewHostMsg_OnCSSInserted, OnCSSInserted) | 804 IPC_MESSAGE_HANDLER(ViewHostMsg_OnCSSInserted, OnCSSInserted) |
805 IPC_MESSAGE_HANDLER(ViewHostMsg_ContentBlocked, OnContentBlocked) | 805 IPC_MESSAGE_HANDLER(ViewHostMsg_ContentBlocked, OnContentBlocked) |
806 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) | 806 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) |
807 IPC_MESSAGE_HANDLER(ViewHostMsg_WebDatabaseAccessed, OnWebDatabaseAccessed) | 807 IPC_MESSAGE_HANDLER(ViewHostMsg_WebDatabaseAccessed, OnWebDatabaseAccessed) |
808 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnMsgFocusedNodeChanged) | 808 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnMsgFocusedNodeChanged) |
809 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) | 809 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) |
810 IPC_MESSAGE_HANDLER(ViewHostMsg_DetectedPhishingSite, | |
811 OnDetectedPhishingSite) | |
812 IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse) | 810 IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse) |
813 #if defined(OS_MACOSX) | 811 #if defined(OS_MACOSX) |
814 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnMsgShowPopup) | 812 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnMsgShowPopup) |
815 #endif | 813 #endif |
816 IPC_MESSAGE_HANDLER(ViewHostMsg_CommandStateChanged, | 814 IPC_MESSAGE_HANDLER(ViewHostMsg_CommandStateChanged, |
817 OnCommandStateChanged) | 815 OnCommandStateChanged) |
818 // Have the super handle all other messages. | 816 // Have the super handle all other messages. |
819 IPC_MESSAGE_UNHANDLED(handled = RenderWidgetHost::OnMessageReceived(msg)) | 817 IPC_MESSAGE_UNHANDLED(handled = RenderWidgetHost::OnMessageReceived(msg)) |
820 IPC_END_MESSAGE_MAP_EX() | 818 IPC_END_MESSAGE_MAP_EX() |
821 | 819 |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1653 content_settings_delegate->OnWebDatabaseAccessed( | 1651 content_settings_delegate->OnWebDatabaseAccessed( |
1654 url, name, display_name, estimated_size, blocked_by_policy); | 1652 url, name, display_name, estimated_size, blocked_by_policy); |
1655 } | 1653 } |
1656 | 1654 |
1657 void RenderViewHost::OnUpdateZoomLimits(int minimum_percent, | 1655 void RenderViewHost::OnUpdateZoomLimits(int minimum_percent, |
1658 int maximum_percent, | 1656 int maximum_percent, |
1659 bool remember) { | 1657 bool remember) { |
1660 delegate_->UpdateZoomLimits(minimum_percent, maximum_percent, remember); | 1658 delegate_->UpdateZoomLimits(minimum_percent, maximum_percent, remember); |
1661 } | 1659 } |
1662 | 1660 |
1663 void RenderViewHost::OnDetectedPhishingSite(const GURL& phishing_url, | |
1664 double phishing_score) { | |
1665 // TODO(noelutz): send an HTTP request to the client-side detection frontends | |
1666 // to confirm that the URL is really phishing. | |
1667 } | |
1668 | |
1669 void RenderViewHost::OnScriptEvalResponse(int id, const ListValue& result) { | 1661 void RenderViewHost::OnScriptEvalResponse(int id, const ListValue& result) { |
1670 Value* result_value; | 1662 Value* result_value; |
1671 result.Get(0, &result_value); | 1663 result.Get(0, &result_value); |
1672 std::pair<int, Value*> details(id, result_value); | 1664 std::pair<int, Value*> details(id, result_value); |
1673 NotificationService::current()->Notify( | 1665 NotificationService::current()->Notify( |
1674 NotificationType::EXECUTE_JAVASCRIPT_RESULT, | 1666 NotificationType::EXECUTE_JAVASCRIPT_RESULT, |
1675 Source<RenderViewHost>(this), | 1667 Source<RenderViewHost>(this), |
1676 Details<std::pair<int, Value*> >(&details)); | 1668 Details<std::pair<int, Value*> >(&details)); |
1677 } | 1669 } |
1678 | 1670 |
(...skipping 26 matching lines...) Expand all Loading... |
1705 LOG(DFATAL) << "Invalid checked state " << checked_state; | 1697 LOG(DFATAL) << "Invalid checked state " << checked_state; |
1706 return; | 1698 return; |
1707 } | 1699 } |
1708 | 1700 |
1709 CommandState state; | 1701 CommandState state; |
1710 state.is_enabled = is_enabled; | 1702 state.is_enabled = is_enabled; |
1711 state.checked_state = | 1703 state.checked_state = |
1712 static_cast<RenderViewCommandCheckedState>(checked_state); | 1704 static_cast<RenderViewCommandCheckedState>(checked_state); |
1713 command_states_[static_cast<RenderViewCommand>(command)] = state; | 1705 command_states_[static_cast<RenderViewCommand>(command)] = state; |
1714 } | 1706 } |
OLD | NEW |