| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "grit/renderer_resources.h" | 52 #include "grit/renderer_resources.h" |
| 53 #include "net/base/data_url.h" | 53 #include "net/base/data_url.h" |
| 54 #include "net/base/escape.h" | 54 #include "net/base/escape.h" |
| 55 #include "net/base/net_errors.h" | 55 #include "net/base/net_errors.h" |
| 56 #include "skia/ext/bitmap_platform_device.h" | 56 #include "skia/ext/bitmap_platform_device.h" |
| 57 #include "skia/ext/image_operations.h" | 57 #include "skia/ext/image_operations.h" |
| 58 #include "webkit/api/public/WebDataSource.h" | 58 #include "webkit/api/public/WebDataSource.h" |
| 59 #include "webkit/api/public/WebDragData.h" | 59 #include "webkit/api/public/WebDragData.h" |
| 60 #include "webkit/api/public/WebForm.h" | 60 #include "webkit/api/public/WebForm.h" |
| 61 #include "webkit/api/public/WebHistoryItem.h" | 61 #include "webkit/api/public/WebHistoryItem.h" |
| 62 #include "webkit/api/public/WebNode.h" |
| 62 #include "webkit/api/public/WebPoint.h" | 63 #include "webkit/api/public/WebPoint.h" |
| 63 #include "webkit/api/public/WebRect.h" | 64 #include "webkit/api/public/WebRect.h" |
| 64 #include "webkit/api/public/WebScriptSource.h" | 65 #include "webkit/api/public/WebScriptSource.h" |
| 65 #include "webkit/api/public/WebSize.h" | 66 #include "webkit/api/public/WebSize.h" |
| 66 #include "webkit/api/public/WebURL.h" | 67 #include "webkit/api/public/WebURL.h" |
| 67 #include "webkit/api/public/WebURLError.h" | 68 #include "webkit/api/public/WebURLError.h" |
| 68 #include "webkit/api/public/WebURLRequest.h" | 69 #include "webkit/api/public/WebURLRequest.h" |
| 69 #include "webkit/api/public/WebURLResponse.h" | 70 #include "webkit/api/public/WebURLResponse.h" |
| 70 #include "webkit/api/public/WebVector.h" | 71 #include "webkit/api/public/WebVector.h" |
| 71 #include "webkit/default_plugin/default_plugin_shared.h" | 72 #include "webkit/default_plugin/default_plugin_shared.h" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 OnPopupNotificationVisibilityChanged) | 417 OnPopupNotificationVisibilityChanged) |
| 417 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) | 418 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) |
| 418 IPC_MESSAGE_HANDLER(ViewMsg_ExtensionResponse, OnExtensionResponse) | 419 IPC_MESSAGE_HANDLER(ViewMsg_ExtensionResponse, OnExtensionResponse) |
| 419 IPC_MESSAGE_HANDLER(ViewMsg_ExtensionMessageInvoke, | 420 IPC_MESSAGE_HANDLER(ViewMsg_ExtensionMessageInvoke, |
| 420 OnExtensionMessageInvoke) | 421 OnExtensionMessageInvoke) |
| 421 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedNode, OnClearFocusedNode) | 422 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedNode, OnClearFocusedNode) |
| 422 IPC_MESSAGE_HANDLER(ViewMsg_SetBackground, OnSetBackground) | 423 IPC_MESSAGE_HANDLER(ViewMsg_SetBackground, OnSetBackground) |
| 423 IPC_MESSAGE_HANDLER(ViewMsg_EnableIntrinsicWidthChangedMode, | 424 IPC_MESSAGE_HANDLER(ViewMsg_EnableIntrinsicWidthChangedMode, |
| 424 OnEnableIntrinsicWidthChangedMode) | 425 OnEnableIntrinsicWidthChangedMode) |
| 425 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) | 426 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) |
| 427 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) |
| 426 | 428 |
| 427 // Have the super handle all other messages. | 429 // Have the super handle all other messages. |
| 428 IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message)) | 430 IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message)) |
| 429 IPC_END_MESSAGE_MAP() | 431 IPC_END_MESSAGE_MAP() |
| 430 } | 432 } |
| 431 | 433 |
| 432 void RenderView::SendThumbnail() { | 434 void RenderView::SendThumbnail() { |
| 433 WebFrame* main_frame = webview()->GetMainFrame(); | 435 WebFrame* main_frame = webview()->GetMainFrame(); |
| 434 if (!main_frame) | 436 if (!main_frame) |
| 435 return; | 437 return; |
| (...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1969 const WebHistoryItem& item = | 1971 const WebHistoryItem& item = |
| 1970 webview()->GetMainFrame()->GetCurrentHistoryItem(); | 1972 webview()->GetMainFrame()->GetCurrentHistoryItem(); |
| 1971 if (item.isNull()) | 1973 if (item.isNull()) |
| 1972 return; | 1974 return; |
| 1973 | 1975 |
| 1974 Send(new ViewHostMsg_UpdateState( | 1976 Send(new ViewHostMsg_UpdateState( |
| 1975 routing_id_, page_id_, webkit_glue::HistoryItemToString(item))); | 1977 routing_id_, page_id_, webkit_glue::HistoryItemToString(item))); |
| 1976 } | 1978 } |
| 1977 | 1979 |
| 1978 void RenderView::ShowContextMenu(WebView* webview, | 1980 void RenderView::ShowContextMenu(WebView* webview, |
| 1979 ContextNode node, | 1981 ContextNodeType node_type, |
| 1980 int x, | 1982 int x, |
| 1981 int y, | 1983 int y, |
| 1982 const GURL& link_url, | 1984 const GURL& link_url, |
| 1983 const GURL& src_url, | 1985 const GURL& src_url, |
| 1984 const GURL& page_url, | 1986 const GURL& page_url, |
| 1985 const GURL& frame_url, | 1987 const GURL& frame_url, |
| 1986 const ContextMenuMediaParams& media_params, | 1988 const ContextMenuMediaParams& media_params, |
| 1987 const std::wstring& selection_text, | 1989 const std::wstring& selection_text, |
| 1988 const std::wstring& misspelled_word, | 1990 const std::wstring& misspelled_word, |
| 1989 int edit_flags, | 1991 int edit_flags, |
| 1990 const std::string& security_info, | 1992 const std::string& security_info, |
| 1991 const std::string& frame_charset) { | 1993 const std::string& frame_charset) { |
| 1992 ContextMenuParams params; | 1994 ContextMenuParams params; |
| 1993 params.node = node; | 1995 params.node_type = node_type; |
| 1994 params.x = x; | 1996 params.x = x; |
| 1995 params.y = y; | 1997 params.y = y; |
| 1996 params.src_url = src_url; | 1998 params.src_url = src_url; |
| 1997 params.link_url = link_url; | 1999 params.link_url = link_url; |
| 1998 params.unfiltered_link_url = link_url; | 2000 params.unfiltered_link_url = link_url; |
| 1999 params.page_url = page_url; | 2001 params.page_url = page_url; |
| 2000 params.frame_url = frame_url; | 2002 params.frame_url = frame_url; |
| 2001 params.media_params = media_params; | 2003 params.media_params = media_params; |
| 2002 params.selection_text = selection_text; | 2004 params.selection_text = selection_text; |
| 2003 params.misspelled_word = misspelled_word; | 2005 params.misspelled_word = misspelled_word; |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2624 } | 2626 } |
| 2625 | 2627 |
| 2626 void RenderView::OnEnableIntrinsicWidthChangedMode() { | 2628 void RenderView::OnEnableIntrinsicWidthChangedMode() { |
| 2627 send_preferred_width_changes_ = true; | 2629 send_preferred_width_changes_ = true; |
| 2628 } | 2630 } |
| 2629 | 2631 |
| 2630 void RenderView::OnSetRendererPrefs(const RendererPreferences& renderer_prefs) { | 2632 void RenderView::OnSetRendererPrefs(const RendererPreferences& renderer_prefs) { |
| 2631 renderer_preferences_ = renderer_prefs; | 2633 renderer_preferences_ = renderer_prefs; |
| 2632 } | 2634 } |
| 2633 | 2635 |
| 2636 void RenderView::OnMediaPlayerActionAt(int x, |
| 2637 int y, |
| 2638 const MediaPlayerAction& action) { |
| 2639 if (!webview()) |
| 2640 return; |
| 2641 |
| 2642 webview()->MediaPlayerActionAt(x, y, action); |
| 2643 } |
| 2644 |
| 2634 void RenderView::OnUpdateBackForwardListCount(int back_list_count, | 2645 void RenderView::OnUpdateBackForwardListCount(int back_list_count, |
| 2635 int forward_list_count) { | 2646 int forward_list_count) { |
| 2636 history_back_list_count_ = back_list_count; | 2647 history_back_list_count_ = back_list_count; |
| 2637 history_forward_list_count_ = forward_list_count; | 2648 history_forward_list_count_ = forward_list_count; |
| 2638 } | 2649 } |
| 2639 | 2650 |
| 2640 void RenderView::OnGetAccessibilityInfo( | 2651 void RenderView::OnGetAccessibilityInfo( |
| 2641 const webkit_glue::WebAccessibility::InParams& in_params, | 2652 const webkit_glue::WebAccessibility::InParams& in_params, |
| 2642 webkit_glue::WebAccessibility::OutParams* out_params) { | 2653 webkit_glue::WebAccessibility::OutParams* out_params) { |
| 2643 #if defined(OS_WIN) | 2654 #if defined(OS_WIN) |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3066 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms)); | 3077 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms)); |
| 3067 } | 3078 } |
| 3068 | 3079 |
| 3069 void RenderView::Print(WebFrame* frame, bool script_initiated) { | 3080 void RenderView::Print(WebFrame* frame, bool script_initiated) { |
| 3070 DCHECK(frame); | 3081 DCHECK(frame); |
| 3071 if (print_helper_.get() == NULL) { | 3082 if (print_helper_.get() == NULL) { |
| 3072 print_helper_.reset(new PrintWebViewHelper(this)); | 3083 print_helper_.reset(new PrintWebViewHelper(this)); |
| 3073 } | 3084 } |
| 3074 print_helper_->Print(frame, script_initiated); | 3085 print_helper_->Print(frame, script_initiated); |
| 3075 } | 3086 } |
| OLD | NEW |