OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "chrome/common/render_messages.h" | 34 #include "chrome/common/render_messages.h" |
35 #include "chrome/common/result_codes.h" | 35 #include "chrome/common/result_codes.h" |
36 #include "chrome/common/chrome_switches.h" | 36 #include "chrome/common/chrome_switches.h" |
37 #include "chrome/common/thumbnail_score.h" | 37 #include "chrome/common/thumbnail_score.h" |
38 #include "chrome/common/url_constants.h" | 38 #include "chrome/common/url_constants.h" |
39 #include "net/base/net_util.h" | 39 #include "net/base/net_util.h" |
40 #include "third_party/skia/include/core/SkBitmap.h" | 40 #include "third_party/skia/include/core/SkBitmap.h" |
41 #include "webkit/api/public/WebFindOptions.h" | 41 #include "webkit/api/public/WebFindOptions.h" |
42 #include "webkit/glue/autofill_form.h" | 42 #include "webkit/glue/autofill_form.h" |
43 | 43 |
| 44 #if defined(OS_WIN) |
| 45 // TODO(port): accessibility not yet implemented. See http://crbug.com/8288. |
| 46 #include "chrome/browser/browser_accessibility_manager.h" |
| 47 #endif |
| 48 |
44 using base::TimeDelta; | 49 using base::TimeDelta; |
45 using WebKit::WebConsoleMessage; | 50 using WebKit::WebConsoleMessage; |
46 using WebKit::WebFindOptions; | 51 using WebKit::WebFindOptions; |
47 using WebKit::WebInputEvent; | 52 using WebKit::WebInputEvent; |
48 | 53 |
49 namespace { | 54 namespace { |
50 | 55 |
51 void FilterURL(RendererSecurityPolicy* policy, int renderer_id, GURL* url) { | 56 void FilterURL(RendererSecurityPolicy* policy, int renderer_id, GURL* url) { |
52 if (!url->is_valid()) | 57 if (!url->is_valid()) |
53 return; // We don't need to block invalid URLs. | 58 return; // We don't need to block invalid URLs. |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 IPC_MESSAGE_HANDLER(ViewHostMsg_QueryFormFieldAutofill, | 795 IPC_MESSAGE_HANDLER(ViewHostMsg_QueryFormFieldAutofill, |
791 OnQueryFormFieldAutofill) | 796 OnQueryFormFieldAutofill) |
792 IPC_MESSAGE_HANDLER(ViewHostMsg_RemoveAutofillEntry, | 797 IPC_MESSAGE_HANDLER(ViewHostMsg_RemoveAutofillEntry, |
793 OnRemoveAutofillEntry) | 798 OnRemoveAutofillEntry) |
794 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRequest, OnExtensionRequest) | 799 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRequest, OnExtensionRequest) |
795 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged) | 800 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged) |
796 IPC_MESSAGE_HANDLER(ViewHostMsg_PasteFromSelectionClipboard, | 801 IPC_MESSAGE_HANDLER(ViewHostMsg_PasteFromSelectionClipboard, |
797 OnMsgPasteFromSelectionClipboard) | 802 OnMsgPasteFromSelectionClipboard) |
798 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionPostMessage, | 803 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionPostMessage, |
799 OnExtensionPostMessage) | 804 OnExtensionPostMessage) |
| 805 IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityFocusChange, |
| 806 OnAccessibilityFocusChange) |
800 // Have the super handle all other messages. | 807 // Have the super handle all other messages. |
801 IPC_MESSAGE_UNHANDLED(RenderWidgetHost::OnMessageReceived(msg)) | 808 IPC_MESSAGE_UNHANDLED(RenderWidgetHost::OnMessageReceived(msg)) |
802 IPC_END_MESSAGE_MAP_EX() | 809 IPC_END_MESSAGE_MAP_EX() |
803 | 810 |
804 if (!msg_is_ok) { | 811 if (!msg_is_ok) { |
805 // The message had a handler, but its de-serialization failed. | 812 // The message had a handler, but its de-serialization failed. |
806 // Kill the renderer. | 813 // Kill the renderer. |
807 process()->ReceivedBadMessage(msg.type()); | 814 process()->ReceivedBadMessage(msg.type()); |
808 } | 815 } |
809 } | 816 } |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 Send(new ViewMsg_ExtensionResponse(routing_id(), request_id, success, | 1409 Send(new ViewMsg_ExtensionResponse(routing_id(), request_id, success, |
1403 response, error)); | 1410 response, error)); |
1404 } | 1411 } |
1405 | 1412 |
1406 void RenderViewHost::OnExtensionPostMessage( | 1413 void RenderViewHost::OnExtensionPostMessage( |
1407 int port_id, const std::string& message) { | 1414 int port_id, const std::string& message) { |
1408 URLRequestContext* context = process()->profile()->GetRequestContext(); | 1415 URLRequestContext* context = process()->profile()->GetRequestContext(); |
1409 ExtensionMessageService::GetInstance(context)-> | 1416 ExtensionMessageService::GetInstance(context)-> |
1410 PostMessageFromRenderer(port_id, message); | 1417 PostMessageFromRenderer(port_id, message); |
1411 } | 1418 } |
| 1419 |
| 1420 void RenderViewHost::OnAccessibilityFocusChange(int acc_obj_id) { |
| 1421 #if defined(OS_WIN) |
| 1422 BrowserAccessibilityManager::GetInstance()-> |
| 1423 ChangeAccessibilityFocus(acc_obj_id, process()->pid(), routing_id()); |
| 1424 #else |
| 1425 // TODO(port): accessibility not yet implemented. See http://crbug.com/8288. |
| 1426 #endif |
| 1427 } |
OLD | NEW |