| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 29 matching lines...) Expand all Loading... |
| 40 #include "grit/generated_resources.h" | 40 #include "grit/generated_resources.h" |
| 41 #include "grit/renderer_resources.h" | 41 #include "grit/renderer_resources.h" |
| 42 #include "net/base/escape.h" | 42 #include "net/base/escape.h" |
| 43 #include "net/base/net_errors.h" | 43 #include "net/base/net_errors.h" |
| 44 #include "printing/units.h" | 44 #include "printing/units.h" |
| 45 #include "skia/ext/bitmap_platform_device.h" | 45 #include "skia/ext/bitmap_platform_device.h" |
| 46 #include "skia/ext/image_operations.h" | 46 #include "skia/ext/image_operations.h" |
| 47 #include "webkit/default_plugin/default_plugin_shared.h" | 47 #include "webkit/default_plugin/default_plugin_shared.h" |
| 48 #include "webkit/glue/dom_operations.h" | 48 #include "webkit/glue/dom_operations.h" |
| 49 #include "webkit/glue/dom_serializer.h" | 49 #include "webkit/glue/dom_serializer.h" |
| 50 #include "webkit/glue/glue_accessibility.h" | |
| 51 #include "webkit/glue/password_form.h" | 50 #include "webkit/glue/password_form.h" |
| 52 #include "webkit/glue/plugins/plugin_list.h" | 51 #include "webkit/glue/plugins/plugin_list.h" |
| 53 #include "webkit/glue/searchable_form_data.h" | 52 #include "webkit/glue/searchable_form_data.h" |
| 53 #include "webkit/glue/webaccessibilitymanager_impl.h" |
| 54 #include "webkit/glue/webdatasource.h" | 54 #include "webkit/glue/webdatasource.h" |
| 55 #include "webkit/glue/webdevtoolsagent_delegate.h" | 55 #include "webkit/glue/webdevtoolsagent_delegate.h" |
| 56 #include "webkit/glue/webdropdata.h" | 56 #include "webkit/glue/webdropdata.h" |
| 57 #include "webkit/glue/weberror.h" | 57 #include "webkit/glue/weberror.h" |
| 58 #include "webkit/glue/webframe.h" | 58 #include "webkit/glue/webframe.h" |
| 59 #include "webkit/glue/webhistoryitem.h" | 59 #include "webkit/glue/webhistoryitem.h" |
| 60 #include "webkit/glue/webinputevent.h" | 60 #include "webkit/glue/webinputevent.h" |
| 61 #include "webkit/glue/webkit_glue.h" | 61 #include "webkit/glue/webkit_glue.h" |
| 62 #include "webkit/glue/webpreferences.h" | 62 #include "webkit/glue/webpreferences.h" |
| 63 #include "webkit/glue/webplugin_delegate.h" | 63 #include "webkit/glue/webplugin_delegate.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 81 | 81 |
| 82 #if defined(OS_WIN) | 82 #if defined(OS_WIN) |
| 83 // If true, the URL of the active renderer is logged. Logging is done in such | 83 // If true, the URL of the active renderer is logged. Logging is done in such |
| 84 // way that if the renderer crashes the URL of the active renderer is contained | 84 // way that if the renderer crashes the URL of the active renderer is contained |
| 85 // in the dump. Currently mini-dumps are only supported on windows, so this is | 85 // in the dump. Currently mini-dumps are only supported on windows, so this is |
| 86 // only enabled on windows. | 86 // only enabled on windows. |
| 87 #define LOG_RENDERER_URL | 87 #define LOG_RENDERER_URL |
| 88 #endif | 88 #endif |
| 89 | 89 |
| 90 using base::TimeDelta; | 90 using base::TimeDelta; |
| 91 using webkit_glue::WebAccessibility; |
| 91 | 92 |
| 92 //----------------------------------------------------------------------------- | 93 //----------------------------------------------------------------------------- |
| 93 | 94 |
| 94 // define to write the time necessary for thumbnail/DOM text retrieval, | 95 // define to write the time necessary for thumbnail/DOM text retrieval, |
| 95 // respectively, into the system debug log | 96 // respectively, into the system debug log |
| 96 // #define TIME_BITMAP_RETRIEVAL | 97 // #define TIME_BITMAP_RETRIEVAL |
| 97 // #define TIME_TEXT_RETRIEVAL | 98 // #define TIME_TEXT_RETRIEVAL |
| 98 | 99 |
| 99 // maximum number of characters in the document to index, any text beyond this | 100 // maximum number of characters in the document to index, any text beyond this |
| 100 // point will be clipped | 101 // point will be clipped |
| (...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 | 1080 |
| 1080 last_page_id_sent_to_browser_ = | 1081 last_page_id_sent_to_browser_ = |
| 1081 std::max(last_page_id_sent_to_browser_, page_id_); | 1082 std::max(last_page_id_sent_to_browser_, page_id_); |
| 1082 | 1083 |
| 1083 // If we end up reusing this WebRequest (for example, due to a #ref click), | 1084 // If we end up reusing this WebRequest (for example, due to a #ref click), |
| 1084 // we don't want the transition type to persist. | 1085 // we don't want the transition type to persist. |
| 1085 if (extra_data) | 1086 if (extra_data) |
| 1086 extra_data->transition_type = PageTransition::LINK; // Just clear it. | 1087 extra_data->transition_type = PageTransition::LINK; // Just clear it. |
| 1087 | 1088 |
| 1088 #if defined(OS_WIN) | 1089 #if defined(OS_WIN) |
| 1089 if (glue_accessibility_.get()) { | 1090 if (web_accessibility_manager_.get()) { |
| 1090 // Clear accessibility info cache. | 1091 // Clear accessibility info cache. |
| 1091 glue_accessibility_->ClearIAccessibleMap(-1, true); | 1092 web_accessibility_manager_->ClearAccObjMap(-1, true); |
| 1092 } | 1093 } |
| 1093 #else | 1094 #else |
| 1094 // TODO(port): accessibility not yet implemented. See http://crbug.com/8288. | 1095 // TODO(port): accessibility not yet implemented. See http://crbug.com/8288. |
| 1095 #endif | 1096 #endif |
| 1096 } | 1097 } |
| 1097 | 1098 |
| 1098 // Tell the embedding application that the title of the active page has changed | 1099 // Tell the embedding application that the title of the active page has changed |
| 1099 void RenderView::UpdateTitle(WebFrame* frame, const std::wstring& title) { | 1100 void RenderView::UpdateTitle(WebFrame* frame, const std::wstring& title) { |
| 1100 // Ignore all but top level navigations... | 1101 // Ignore all but top level navigations... |
| 1101 if (webview()->GetMainFrame() == frame) | 1102 if (webview()->GetMainFrame() == frame) |
| (...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2622 main_frame->SetInViewSourceMode(true); | 2623 main_frame->SetInViewSourceMode(true); |
| 2623 } | 2624 } |
| 2624 | 2625 |
| 2625 void RenderView::OnUpdateBackForwardListCount(int back_list_count, | 2626 void RenderView::OnUpdateBackForwardListCount(int back_list_count, |
| 2626 int forward_list_count) { | 2627 int forward_list_count) { |
| 2627 history_back_list_count_ = back_list_count; | 2628 history_back_list_count_ = back_list_count; |
| 2628 history_forward_list_count_ = forward_list_count; | 2629 history_forward_list_count_ = forward_list_count; |
| 2629 } | 2630 } |
| 2630 | 2631 |
| 2631 void RenderView::OnGetAccessibilityInfo( | 2632 void RenderView::OnGetAccessibilityInfo( |
| 2632 const AccessibilityInParams& in_params, | 2633 const webkit_glue::WebAccessibility::InParams& in_params, |
| 2633 AccessibilityOutParams* out_params) { | 2634 webkit_glue::WebAccessibility::OutParams* out_params) { |
| 2634 #if defined(OS_WIN) | 2635 #if defined(OS_WIN) |
| 2635 if (!glue_accessibility_.get()) | 2636 if (!web_accessibility_manager_.get()) { |
| 2636 glue_accessibility_.reset(new GlueAccessibility()); | 2637 web_accessibility_manager_.reset( |
| 2638 webkit_glue::WebAccessibilityManager::Create()); |
| 2639 } |
| 2637 | 2640 |
| 2638 if (!glue_accessibility_-> | 2641 if (!web_accessibility_manager_->GetAccObjInfo(webview(), in_params, |
| 2639 GetAccessibilityInfo(webview(), in_params, out_params)) { | 2642 out_params)) { |
| 2640 return; | 2643 return; |
| 2641 } | 2644 } |
| 2642 #else // defined(OS_WIN) | 2645 #else // defined(OS_WIN) |
| 2643 // TODO(port): accessibility not yet implemented | 2646 // TODO(port): accessibility not yet implemented |
| 2644 NOTIMPLEMENTED(); | 2647 NOTIMPLEMENTED(); |
| 2645 #endif | 2648 #endif |
| 2646 } | 2649 } |
| 2647 | 2650 |
| 2648 void RenderView::OnClearAccessibilityInfo(int iaccessible_id, bool clear_all) { | 2651 void RenderView::OnClearAccessibilityInfo(int acc_obj_id, bool clear_all) { |
| 2649 #if defined(OS_WIN) | 2652 #if defined(OS_WIN) |
| 2650 if (!glue_accessibility_.get()) { | 2653 if (!web_accessibility_manager_.get()) { |
| 2651 // If accessibility is not activated, ignore clearing message. | 2654 // If accessibility is not activated, ignore clearing message. |
| 2652 return; | 2655 return; |
| 2653 } | 2656 } |
| 2654 | 2657 if (!web_accessibility_manager_->ClearAccObjMap(acc_obj_id, clear_all)) |
| 2655 if (!glue_accessibility_->ClearIAccessibleMap(iaccessible_id, clear_all)) | |
| 2656 return; | 2658 return; |
| 2657 #else // defined(OS_WIN) | 2659 #else // defined(OS_WIN) |
| 2658 // TODO(port): accessibility not yet implemented | 2660 // TODO(port): accessibility not yet implemented |
| 2659 NOTIMPLEMENTED(); | 2661 NOTIMPLEMENTED(); |
| 2660 #endif | 2662 #endif |
| 2661 } | 2663 } |
| 2662 | 2664 |
| 2663 void RenderView::OnGetAllSavableResourceLinksForCurrentPage( | 2665 void RenderView::OnGetAllSavableResourceLinksForCurrentPage( |
| 2664 const GURL& page_url) { | 2666 const GURL& page_url) { |
| 2665 // Prepare list to storage all savable resource links. | 2667 // Prepare list to storage all savable resource links. |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2920 DCHECK(audio_renderers_.Lookup(stream_id) != NULL); | 2922 DCHECK(audio_renderers_.Lookup(stream_id) != NULL); |
| 2921 Send(new ViewHostMsg_SetAudioVolume(routing_id_, stream_id, left, right)); | 2923 Send(new ViewHostMsg_SetAudioVolume(routing_id_, stream_id, left, right)); |
| 2922 } | 2924 } |
| 2923 | 2925 |
| 2924 void RenderView::OnResize(const gfx::Size& new_size, | 2926 void RenderView::OnResize(const gfx::Size& new_size, |
| 2925 const gfx::Rect& resizer_rect) { | 2927 const gfx::Rect& resizer_rect) { |
| 2926 if (webview()) | 2928 if (webview()) |
| 2927 webview()->HideAutofillPopup(); | 2929 webview()->HideAutofillPopup(); |
| 2928 RenderWidget::OnResize(new_size, resizer_rect); | 2930 RenderWidget::OnResize(new_size, resizer_rect); |
| 2929 } | 2931 } |
| OLD | NEW |