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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 using base::TimeDelta; | 101 using base::TimeDelta; |
102 using webkit_glue::AltErrorPageResourceFetcher; | 102 using webkit_glue::AltErrorPageResourceFetcher; |
103 using webkit_glue::AutofillForm; | 103 using webkit_glue::AutofillForm; |
104 using webkit_glue::PasswordForm; | 104 using webkit_glue::PasswordForm; |
105 using webkit_glue::PasswordFormDomManager; | 105 using webkit_glue::PasswordFormDomManager; |
106 using webkit_glue::SearchableFormData; | 106 using webkit_glue::SearchableFormData; |
107 using WebKit::WebConsoleMessage; | 107 using WebKit::WebConsoleMessage; |
108 using WebKit::WebData; | 108 using WebKit::WebData; |
109 using WebKit::WebDataSource; | 109 using WebKit::WebDataSource; |
110 using WebKit::WebDragData; | 110 using WebKit::WebDragData; |
| 111 using WebKit::WebDragOperation; |
| 112 using WebKit::WebDragOperationsMask; |
111 using WebKit::WebForm; | 113 using WebKit::WebForm; |
112 using WebKit::WebFrame; | 114 using WebKit::WebFrame; |
113 using WebKit::WebHistoryItem; | 115 using WebKit::WebHistoryItem; |
114 using WebKit::WebNavigationPolicy; | 116 using WebKit::WebNavigationPolicy; |
115 using WebKit::WebNavigationType; | 117 using WebKit::WebNavigationType; |
116 using WebKit::WebPopupMenuInfo; | 118 using WebKit::WebPopupMenuInfo; |
117 using WebKit::WebRect; | 119 using WebKit::WebRect; |
118 using WebKit::WebScriptSource; | 120 using WebKit::WebScriptSource; |
119 using WebKit::WebSettings; | 121 using WebKit::WebSettings; |
120 using WebKit::WebSize; | 122 using WebKit::WebSize; |
(...skipping 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2137 params.misspelled_word = misspelled_word; | 2139 params.misspelled_word = misspelled_word; |
2138 params.spellcheck_enabled = | 2140 params.spellcheck_enabled = |
2139 webview->GetFocusedFrame()->isContinuousSpellCheckingEnabled(); | 2141 webview->GetFocusedFrame()->isContinuousSpellCheckingEnabled(); |
2140 params.edit_flags = edit_flags; | 2142 params.edit_flags = edit_flags; |
2141 params.security_info = security_info; | 2143 params.security_info = security_info; |
2142 params.frame_charset = frame_charset; | 2144 params.frame_charset = frame_charset; |
2143 Send(new ViewHostMsg_ContextMenu(routing_id_, params)); | 2145 Send(new ViewHostMsg_ContextMenu(routing_id_, params)); |
2144 } | 2146 } |
2145 | 2147 |
2146 void RenderView::StartDragging(WebView* webview, | 2148 void RenderView::StartDragging(WebView* webview, |
2147 const WebDragData& drag_data) { | 2149 const WebKit::WebPoint &mouseCoords, |
2148 Send(new ViewHostMsg_StartDragging(routing_id_, WebDropData(drag_data))); | 2150 const WebDragData& drag_data, |
| 2151 WebDragOperationsMask allowed_ops) { |
| 2152 Send(new ViewHostMsg_StartDragging(routing_id_, |
| 2153 WebDropData(drag_data), |
| 2154 allowed_ops)); |
2149 } | 2155 } |
2150 | 2156 |
2151 void RenderView::TakeFocus(WebView* webview, bool reverse) { | 2157 void RenderView::TakeFocus(WebView* webview, bool reverse) { |
2152 Send(new ViewHostMsg_TakeFocus(routing_id_, reverse)); | 2158 Send(new ViewHostMsg_TakeFocus(routing_id_, reverse)); |
2153 } | 2159 } |
2154 | 2160 |
2155 void RenderView::DidDownloadImage(int id, | 2161 void RenderView::DidDownloadImage(int id, |
2156 const GURL& image_url, | 2162 const GURL& image_url, |
2157 bool errored, | 2163 bool errored, |
2158 const SkBitmap& image) { | 2164 const SkBitmap& image) { |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2645 DCHECK(BindingsPolicy::is_dom_ui_enabled(enabled_bindings_)); | 2651 DCHECK(BindingsPolicy::is_dom_ui_enabled(enabled_bindings_)); |
2646 dom_ui_bindings_.SetProperty(name, value); | 2652 dom_ui_bindings_.SetProperty(name, value); |
2647 } | 2653 } |
2648 | 2654 |
2649 void RenderView::OnReservePageIDRange(int size_of_range) { | 2655 void RenderView::OnReservePageIDRange(int size_of_range) { |
2650 next_page_id_ += size_of_range + 1; | 2656 next_page_id_ += size_of_range + 1; |
2651 } | 2657 } |
2652 | 2658 |
2653 void RenderView::OnDragSourceEndedOrMoved(const gfx::Point& client_point, | 2659 void RenderView::OnDragSourceEndedOrMoved(const gfx::Point& client_point, |
2654 const gfx::Point& screen_point, | 2660 const gfx::Point& screen_point, |
2655 bool ended, bool cancelled) { | 2661 bool ended, |
| 2662 WebDragOperation op) { |
2656 if (ended) { | 2663 if (ended) { |
2657 if (cancelled) | 2664 webview()->DragSourceEndedAt(client_point, screen_point, op); |
2658 webview()->DragSourceCancelledAt(client_point, screen_point); | |
2659 else | |
2660 webview()->DragSourceEndedAt(client_point, screen_point); | |
2661 } else { | 2665 } else { |
2662 webview()->DragSourceMovedTo(client_point, screen_point); | 2666 webview()->DragSourceMovedTo(client_point, screen_point); |
2663 } | 2667 } |
2664 } | 2668 } |
2665 | 2669 |
2666 void RenderView::OnDragSourceSystemDragEnded() { | 2670 void RenderView::OnDragSourceSystemDragEnded() { |
2667 webview()->DragSourceSystemDragEnded(); | 2671 webview()->DragSourceSystemDragEnded(); |
2668 } | 2672 } |
2669 | 2673 |
2670 void RenderView::OnUploadFileRequest(const ViewMsg_UploadFile_Params& p) { | 2674 void RenderView::OnUploadFileRequest(const ViewMsg_UploadFile_Params& p) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2707 webkit_glue::FillForm(this->webview(), form); | 2711 webkit_glue::FillForm(this->webview(), form); |
2708 } | 2712 } |
2709 | 2713 |
2710 void RenderView::OnFillPasswordForm( | 2714 void RenderView::OnFillPasswordForm( |
2711 const webkit_glue::PasswordFormDomManager::FillData& form_data) { | 2715 const webkit_glue::PasswordFormDomManager::FillData& form_data) { |
2712 webkit_glue::FillPasswordForm(this->webview(), form_data); | 2716 webkit_glue::FillPasswordForm(this->webview(), form_data); |
2713 } | 2717 } |
2714 | 2718 |
2715 void RenderView::OnDragTargetDragEnter(const WebDropData& drop_data, | 2719 void RenderView::OnDragTargetDragEnter(const WebDropData& drop_data, |
2716 const gfx::Point& client_point, | 2720 const gfx::Point& client_point, |
2717 const gfx::Point& screen_point) { | 2721 const gfx::Point& screen_point, |
2718 bool is_drop_target = webview()->DragTargetDragEnter( | 2722 WebDragOperationsMask ops) { |
| 2723 WebDragOperation operation = webview()->DragTargetDragEnter( |
2719 drop_data.ToDragData(), | 2724 drop_data.ToDragData(), |
2720 drop_data.identity, | 2725 drop_data.identity, |
2721 client_point, | 2726 client_point, |
2722 screen_point); | 2727 screen_point, |
| 2728 ops); |
2723 | 2729 |
2724 Send(new ViewHostMsg_UpdateDragCursor(routing_id_, is_drop_target)); | 2730 Send(new ViewHostMsg_UpdateDragCursor(routing_id_, operation)); |
2725 } | 2731 } |
2726 | 2732 |
2727 void RenderView::OnDragTargetDragOver(const gfx::Point& client_point, | 2733 void RenderView::OnDragTargetDragOver(const gfx::Point& client_point, |
2728 const gfx::Point& screen_point) { | 2734 const gfx::Point& screen_point, |
2729 bool is_drop_target = | 2735 WebDragOperationsMask ops) { |
2730 webview()->DragTargetDragOver(client_point, screen_point); | 2736 WebDragOperation operation = webview()->DragTargetDragOver( |
| 2737 client_point, |
| 2738 screen_point, |
| 2739 ops); |
2731 | 2740 |
2732 Send(new ViewHostMsg_UpdateDragCursor(routing_id_, is_drop_target)); | 2741 Send(new ViewHostMsg_UpdateDragCursor(routing_id_, operation)); |
2733 } | 2742 } |
2734 | 2743 |
2735 void RenderView::OnDragTargetDragLeave() { | 2744 void RenderView::OnDragTargetDragLeave() { |
2736 webview()->DragTargetDragLeave(); | 2745 webview()->DragTargetDragLeave(); |
2737 } | 2746 } |
2738 | 2747 |
2739 void RenderView::OnDragTargetDrop(const gfx::Point& client_point, | 2748 void RenderView::OnDragTargetDrop(const gfx::Point& client_point, |
2740 const gfx::Point& screen_point) { | 2749 const gfx::Point& screen_point) { |
2741 webview()->DragTargetDrop(client_point, screen_point); | 2750 webview()->DragTargetDrop(client_point, screen_point); |
2742 } | 2751 } |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3332 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms)); | 3341 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms)); |
3333 } | 3342 } |
3334 | 3343 |
3335 void RenderView::Print(WebFrame* frame, bool script_initiated) { | 3344 void RenderView::Print(WebFrame* frame, bool script_initiated) { |
3336 DCHECK(frame); | 3345 DCHECK(frame); |
3337 if (print_helper_.get() == NULL) { | 3346 if (print_helper_.get() == NULL) { |
3338 print_helper_.reset(new PrintWebViewHelper(this)); | 3347 print_helper_.reset(new PrintWebViewHelper(this)); |
3339 } | 3348 } |
3340 print_helper_->Print(frame, script_initiated); | 3349 print_helper_->Print(frame, script_initiated); |
3341 } | 3350 } |
OLD | NEW |