| 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/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 #include "chrome/renderer/webworker_proxy.h" | 54 #include "chrome/renderer/webworker_proxy.h" |
| 55 #include "grit/generated_resources.h" | 55 #include "grit/generated_resources.h" |
| 56 #include "grit/renderer_resources.h" | 56 #include "grit/renderer_resources.h" |
| 57 #include "net/base/data_url.h" | 57 #include "net/base/data_url.h" |
| 58 #include "net/base/escape.h" | 58 #include "net/base/escape.h" |
| 59 #include "net/base/net_errors.h" | 59 #include "net/base/net_errors.h" |
| 60 #include "skia/ext/bitmap_platform_device.h" | 60 #include "skia/ext/bitmap_platform_device.h" |
| 61 #include "skia/ext/image_operations.h" | 61 #include "skia/ext/image_operations.h" |
| 62 #include "webkit/api/public/WebAccessibilityObject.h" | 62 #include "webkit/api/public/WebAccessibilityObject.h" |
| 63 #include "webkit/api/public/WebDataSource.h" | 63 #include "webkit/api/public/WebDataSource.h" |
| 64 #include "webkit/api/public/WebDevToolsAgentClient.h" |
| 64 #include "webkit/api/public/WebDragData.h" | 65 #include "webkit/api/public/WebDragData.h" |
| 65 #include "webkit/api/public/WebForm.h" | 66 #include "webkit/api/public/WebForm.h" |
| 66 #include "webkit/api/public/WebFrame.h" | 67 #include "webkit/api/public/WebFrame.h" |
| 67 #include "webkit/api/public/WebHistoryItem.h" | 68 #include "webkit/api/public/WebHistoryItem.h" |
| 68 #include "webkit/api/public/WebNode.h" | 69 #include "webkit/api/public/WebNode.h" |
| 69 #include "webkit/api/public/WebPoint.h" | 70 #include "webkit/api/public/WebPoint.h" |
| 70 #include "webkit/api/public/WebRect.h" | 71 #include "webkit/api/public/WebRect.h" |
| 71 #include "webkit/api/public/WebScriptSource.h" | 72 #include "webkit/api/public/WebScriptSource.h" |
| 72 #include "webkit/api/public/WebSecurityOrigin.h" | 73 #include "webkit/api/public/WebSecurityOrigin.h" |
| 73 #include "webkit/api/public/WebSize.h" | 74 #include "webkit/api/public/WebSize.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 85 #include "webkit/glue/dom_serializer.h" | 86 #include "webkit/glue/dom_serializer.h" |
| 86 #include "webkit/glue/image_decoder.h" | 87 #include "webkit/glue/image_decoder.h" |
| 87 #include "webkit/glue/media/buffered_data_source.h" | 88 #include "webkit/glue/media/buffered_data_source.h" |
| 88 #include "webkit/glue/media/simple_data_source.h" | 89 #include "webkit/glue/media/simple_data_source.h" |
| 89 #include "webkit/glue/password_form.h" | 90 #include "webkit/glue/password_form.h" |
| 90 #include "webkit/glue/plugins/plugin_list.h" | 91 #include "webkit/glue/plugins/plugin_list.h" |
| 91 #include "webkit/glue/plugins/webplugin_delegate_impl.h" | 92 #include "webkit/glue/plugins/webplugin_delegate_impl.h" |
| 92 #include "webkit/glue/plugins/webplugin_delegate_pepper_impl.h" | 93 #include "webkit/glue/plugins/webplugin_delegate_pepper_impl.h" |
| 93 #include "webkit/glue/searchable_form_data.h" | 94 #include "webkit/glue/searchable_form_data.h" |
| 94 #include "webkit/glue/webaccessibilitymanager_impl.h" | 95 #include "webkit/glue/webaccessibilitymanager_impl.h" |
| 95 #include "webkit/glue/webdevtoolsagent_delegate.h" | |
| 96 #include "webkit/glue/webdropdata.h" | 96 #include "webkit/glue/webdropdata.h" |
| 97 #include "webkit/glue/webkit_glue.h" | 97 #include "webkit/glue/webkit_glue.h" |
| 98 #include "webkit/glue/webmediaplayer_impl.h" | 98 #include "webkit/glue/webmediaplayer_impl.h" |
| 99 #include "webkit/glue/webplugin_impl.h" | 99 #include "webkit/glue/webplugin_impl.h" |
| 100 #include "webkit/glue/webview.h" | 100 #include "webkit/glue/webview.h" |
| 101 | 101 |
| 102 #if defined(OS_WIN) | 102 #if defined(OS_WIN) |
| 103 // TODO(port): these files are currently Windows only because they concern: | 103 // TODO(port): these files are currently Windows only because they concern: |
| 104 // * theming | 104 // * theming |
| 105 #include "app/gfx/native_theme_win.h" | 105 #include "app/gfx/native_theme_win.h" |
| 106 #endif | 106 #endif |
| 107 | 107 |
| 108 using base::Time; | 108 using base::Time; |
| 109 using base::TimeDelta; | 109 using base::TimeDelta; |
| 110 using webkit_glue::AltErrorPageResourceFetcher; | 110 using webkit_glue::AltErrorPageResourceFetcher; |
| 111 using webkit_glue::AutofillForm; | 111 using webkit_glue::AutofillForm; |
| 112 using webkit_glue::ImageResourceFetcher; | 112 using webkit_glue::ImageResourceFetcher; |
| 113 using webkit_glue::PasswordForm; | 113 using webkit_glue::PasswordForm; |
| 114 using webkit_glue::PasswordFormDomManager; | 114 using webkit_glue::PasswordFormDomManager; |
| 115 using webkit_glue::SearchableFormData; | 115 using webkit_glue::SearchableFormData; |
| 116 using WebKit::WebAccessibilityObject; | 116 using WebKit::WebAccessibilityObject; |
| 117 using WebKit::WebColor; | 117 using WebKit::WebColor; |
| 118 using WebKit::WebColorName; | 118 using WebKit::WebColorName; |
| 119 using WebKit::WebConsoleMessage; | 119 using WebKit::WebConsoleMessage; |
| 120 using WebKit::WebContextMenuData; | 120 using WebKit::WebContextMenuData; |
| 121 using WebKit::WebData; | 121 using WebKit::WebData; |
| 122 using WebKit::WebDataSource; | 122 using WebKit::WebDataSource; |
| 123 using WebKit::WebDevToolsAgentClient; |
| 123 using WebKit::WebDragData; | 124 using WebKit::WebDragData; |
| 124 using WebKit::WebDragOperation; | 125 using WebKit::WebDragOperation; |
| 125 using WebKit::WebDragOperationsMask; | 126 using WebKit::WebDragOperationsMask; |
| 126 using WebKit::WebEditingAction; | 127 using WebKit::WebEditingAction; |
| 127 using WebKit::WebForm; | 128 using WebKit::WebForm; |
| 128 using WebKit::WebFrame; | 129 using WebKit::WebFrame; |
| 129 using WebKit::WebHistoryItem; | 130 using WebKit::WebHistoryItem; |
| 130 using WebKit::WebMediaPlayer; | 131 using WebKit::WebMediaPlayer; |
| 131 using WebKit::WebMediaPlayerAction; | 132 using WebKit::WebMediaPlayerAction; |
| 132 using WebKit::WebMediaPlayerClient; | 133 using WebKit::WebMediaPlayerClient; |
| (...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1692 | 1693 |
| 1693 history_back_list_count_++; | 1694 history_back_list_count_++; |
| 1694 history_forward_list_count_ = 0; | 1695 history_forward_list_count_ = 0; |
| 1695 } | 1696 } |
| 1696 | 1697 |
| 1697 void RenderView::didUpdateInspectorSettings() { | 1698 void RenderView::didUpdateInspectorSettings() { |
| 1698 Send(new ViewHostMsg_UpdateInspectorSettings( | 1699 Send(new ViewHostMsg_UpdateInspectorSettings( |
| 1699 routing_id_, webview()->inspectorSettings().utf8())); | 1700 routing_id_, webview()->inspectorSettings().utf8())); |
| 1700 } | 1701 } |
| 1701 | 1702 |
| 1703 WebDevToolsAgentClient* RenderView::devToolsAgentClient() { |
| 1704 return devtools_agent_.get(); |
| 1705 } |
| 1706 |
| 1702 void RenderView::queryAutofillSuggestions(const WebNode& node, | 1707 void RenderView::queryAutofillSuggestions(const WebNode& node, |
| 1703 const WebString& name, | 1708 const WebString& name, |
| 1704 const WebString& value) { | 1709 const WebString& value) { |
| 1705 static int query_counter = 0; | 1710 static int query_counter = 0; |
| 1706 autofill_query_id_ = query_counter++; | 1711 autofill_query_id_ = query_counter++; |
| 1707 autofill_query_node_ = node; | 1712 autofill_query_node_ = node; |
| 1708 Send(new ViewHostMsg_QueryFormFieldAutofill( | 1713 Send(new ViewHostMsg_QueryFormFieldAutofill( |
| 1709 routing_id_, autofill_query_id_, name, value)); | 1714 routing_id_, autofill_query_id_, name, value)); |
| 1710 } | 1715 } |
| 1711 | 1716 |
| (...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2802 | 2807 |
| 2803 void RenderView::OnSetPageEncoding(const std::string& encoding_name) { | 2808 void RenderView::OnSetPageEncoding(const std::string& encoding_name) { |
| 2804 webview()->setPageEncoding(WebString::fromUTF8(encoding_name)); | 2809 webview()->setPageEncoding(WebString::fromUTF8(encoding_name)); |
| 2805 } | 2810 } |
| 2806 | 2811 |
| 2807 void RenderView::OnResetPageEncodingToDefault() { | 2812 void RenderView::OnResetPageEncodingToDefault() { |
| 2808 WebString no_encoding; | 2813 WebString no_encoding; |
| 2809 webview()->setPageEncoding(no_encoding); | 2814 webview()->setPageEncoding(no_encoding); |
| 2810 } | 2815 } |
| 2811 | 2816 |
| 2812 WebDevToolsAgentDelegate* RenderView::GetWebDevToolsAgentDelegate() { | |
| 2813 return devtools_agent_.get(); | |
| 2814 } | |
| 2815 | |
| 2816 WebFrame* RenderView::GetChildFrame(const std::wstring& xpath) const { | 2817 WebFrame* RenderView::GetChildFrame(const std::wstring& xpath) const { |
| 2817 if (xpath.empty()) | 2818 if (xpath.empty()) |
| 2818 return webview()->mainFrame(); | 2819 return webview()->mainFrame(); |
| 2819 | 2820 |
| 2820 // xpath string can represent a frame deep down the tree (across multiple | 2821 // xpath string can represent a frame deep down the tree (across multiple |
| 2821 // frame DOMs). | 2822 // frame DOMs). |
| 2822 // Example, /html/body/table/tbody/tr/td/iframe\n/frameset/frame[0] | 2823 // Example, /html/body/table/tbody/tr/td/iframe\n/frameset/frame[0] |
| 2823 // should break into 2 xpaths | 2824 // should break into 2 xpaths |
| 2824 // /html/body/table/tbody/tr/td/iframe & /frameset/frame[0] | 2825 // /html/body/table/tbody/tr/td/iframe & /frameset/frame[0] |
| 2825 | 2826 |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3659 new PluginMsg_SignalModalDialogEvent(host_window_)); | 3660 new PluginMsg_SignalModalDialogEvent(host_window_)); |
| 3660 | 3661 |
| 3661 message->EnableMessagePumping(); // Runs a nested message loop. | 3662 message->EnableMessagePumping(); // Runs a nested message loop. |
| 3662 bool rv = Send(message); | 3663 bool rv = Send(message); |
| 3663 | 3664 |
| 3664 PluginChannelHost::Broadcast( | 3665 PluginChannelHost::Broadcast( |
| 3665 new PluginMsg_ResetModalDialogEvent(host_window_)); | 3666 new PluginMsg_ResetModalDialogEvent(host_window_)); |
| 3666 | 3667 |
| 3667 return rv; | 3668 return rv; |
| 3668 } | 3669 } |
| OLD | NEW |