| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1068 int32 routing_id, | 1068 int32 routing_id, |
| 1069 int32 main_frame_routing_id, | 1069 int32 main_frame_routing_id, |
| 1070 int32 surface_id, | 1070 int32 surface_id, |
| 1071 int64 session_storage_namespace_id, | 1071 int64 session_storage_namespace_id, |
| 1072 const base::string16& frame_name, | 1072 const base::string16& frame_name, |
| 1073 bool is_renderer_created, | 1073 bool is_renderer_created, |
| 1074 bool swapped_out, | 1074 bool swapped_out, |
| 1075 bool hidden, | 1075 bool hidden, |
| 1076 int32 next_page_id, | 1076 int32 next_page_id, |
| 1077 const blink::WebScreenInfo& screen_info, | 1077 const blink::WebScreenInfo& screen_info, |
| 1078 AccessibilityMode accessibility_mode, | 1078 unsigned int accessibility_mode, |
| 1079 bool allow_partial_swap) { | 1079 bool allow_partial_swap) { |
| 1080 DCHECK(routing_id != MSG_ROUTING_NONE); | 1080 DCHECK(routing_id != MSG_ROUTING_NONE); |
| 1081 RenderViewImplParams params( | 1081 RenderViewImplParams params( |
| 1082 opener_id, | 1082 opener_id, |
| 1083 renderer_prefs, | 1083 renderer_prefs, |
| 1084 webkit_prefs, | 1084 webkit_prefs, |
| 1085 routing_id, | 1085 routing_id, |
| 1086 main_frame_routing_id, | 1086 main_frame_routing_id, |
| 1087 surface_id, | 1087 surface_id, |
| 1088 session_storage_namespace_id, | 1088 session_storage_namespace_id, |
| (...skipping 4042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5131 | 5131 |
| 5132 void RenderViewImpl::OnSetBackground(const SkBitmap& background) { | 5132 void RenderViewImpl::OnSetBackground(const SkBitmap& background) { |
| 5133 if (webview()) | 5133 if (webview()) |
| 5134 webview()->setIsTransparent(!background.empty()); | 5134 webview()->setIsTransparent(!background.empty()); |
| 5135 if (compositor_) | 5135 if (compositor_) |
| 5136 compositor_->setHasTransparentBackground(!background.empty()); | 5136 compositor_->setHasTransparentBackground(!background.empty()); |
| 5137 | 5137 |
| 5138 SetBackground(background); | 5138 SetBackground(background); |
| 5139 } | 5139 } |
| 5140 | 5140 |
| 5141 void RenderViewImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { | 5141 void RenderViewImpl::OnSetAccessibilityMode(unsigned int new_mode) { |
| 5142 if (accessibility_mode_ == new_mode) | 5142 if (accessibility_mode_ == new_mode) |
| 5143 return; | 5143 return; |
| 5144 accessibility_mode_ = new_mode; | 5144 accessibility_mode_ = new_mode; |
| 5145 if (renderer_accessibility_) { | 5145 if (renderer_accessibility_) { |
| 5146 delete renderer_accessibility_; | 5146 delete renderer_accessibility_; |
| 5147 renderer_accessibility_ = NULL; | 5147 renderer_accessibility_ = NULL; |
| 5148 } | 5148 } |
| 5149 if (accessibility_mode_ == AccessibilityModeComplete) | 5149 if (accessibility_mode_ == AccessibilityModeOff) |
| 5150 return; |
| 5151 |
| 5152 if (accessibility_mode_ & AccessibilityModeFlagPlatformFullTree) |
| 5150 renderer_accessibility_ = new RendererAccessibilityComplete(this); | 5153 renderer_accessibility_ = new RendererAccessibilityComplete(this); |
| 5151 #if !defined(OS_ANDROID) | 5154 #if !defined(OS_ANDROID) |
| 5152 else if (accessibility_mode_ == AccessibilityModeEditableTextOnly) | 5155 else |
| 5153 renderer_accessibility_ = new RendererAccessibilityFocusOnly(this); | 5156 renderer_accessibility_ = new RendererAccessibilityFocusOnly(this); |
| 5154 #endif | 5157 #endif |
| 5155 } | 5158 } |
| 5156 | 5159 |
| 5157 void RenderViewImpl::OnSetActive(bool active) { | 5160 void RenderViewImpl::OnSetActive(bool active) { |
| 5158 if (webview()) | 5161 if (webview()) |
| 5159 webview()->setIsActive(active); | 5162 webview()->setIsActive(active); |
| 5160 | 5163 |
| 5161 #if defined(ENABLE_PLUGINS) && defined(OS_MACOSX) | 5164 #if defined(ENABLE_PLUGINS) && defined(OS_MACOSX) |
| 5162 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 5165 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5909 if (main_frame && main_frame->opener()) | 5912 if (main_frame && main_frame->opener()) |
| 5910 main_frame->setOpener(NULL); | 5913 main_frame->setOpener(NULL); |
| 5911 } | 5914 } |
| 5912 | 5915 |
| 5913 #if defined(OS_ANDROID) | 5916 #if defined(OS_ANDROID) |
| 5914 bool RenderViewImpl::didTapMultipleTargets( | 5917 bool RenderViewImpl::didTapMultipleTargets( |
| 5915 const blink::WebGestureEvent& event, | 5918 const blink::WebGestureEvent& event, |
| 5916 const WebVector<WebRect>& target_rects) { | 5919 const WebVector<WebRect>& target_rects) { |
| 5917 // Never show a disambiguation popup when accessibility is enabled, | 5920 // Never show a disambiguation popup when accessibility is enabled, |
| 5918 // as this interferes with "touch exploration". | 5921 // as this interferes with "touch exploration". |
| 5919 if (accessibility_mode_ == AccessibilityModeComplete) | 5922 bool matchesAccessibilityModeComplete = |
| 5923 (accessibility_mode_ & AccessibilityModeComplete) == |
| 5924 AccessibilityModeComplete; |
| 5925 if (matchesAccessibilityModeComplete) |
| 5920 return false; | 5926 return false; |
| 5921 | 5927 |
| 5922 gfx::Rect finger_rect( | 5928 gfx::Rect finger_rect( |
| 5923 event.x - event.data.tap.width / 2, event.y - event.data.tap.height / 2, | 5929 event.x - event.data.tap.width / 2, event.y - event.data.tap.height / 2, |
| 5924 event.data.tap.width, event.data.tap.height); | 5930 event.data.tap.width, event.data.tap.height); |
| 5925 gfx::Rect zoom_rect; | 5931 gfx::Rect zoom_rect; |
| 5926 float new_total_scale = | 5932 float new_total_scale = |
| 5927 DisambiguationPopupHelper::ComputeZoomAreaAndScaleFactor( | 5933 DisambiguationPopupHelper::ComputeZoomAreaAndScaleFactor( |
| 5928 finger_rect, target_rects, GetSize(), | 5934 finger_rect, target_rects, GetSize(), |
| 5929 gfx::Rect(webview()->mainFrame()->visibleContentRect()).size(), | 5935 gfx::Rect(webview()->mainFrame()->visibleContentRect()).size(), |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6069 for (size_t i = 0; i < icon_urls.size(); i++) { | 6075 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 6070 WebURL url = icon_urls[i].iconURL(); | 6076 WebURL url = icon_urls[i].iconURL(); |
| 6071 if (!url.isEmpty()) | 6077 if (!url.isEmpty()) |
| 6072 urls.push_back(FaviconURL(url, | 6078 urls.push_back(FaviconURL(url, |
| 6073 ToFaviconType(icon_urls[i].iconType()))); | 6079 ToFaviconType(icon_urls[i].iconType()))); |
| 6074 } | 6080 } |
| 6075 SendUpdateFaviconURL(urls); | 6081 SendUpdateFaviconURL(urls); |
| 6076 } | 6082 } |
| 6077 | 6083 |
| 6078 } // namespace content | 6084 } // namespace content |
| OLD | NEW |