| 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 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 using WebKit::WebGraphicsContext3D; | 219 using WebKit::WebGraphicsContext3D; |
| 220 using WebKit::WebHistoryItem; | 220 using WebKit::WebHistoryItem; |
| 221 using WebKit::WebIconURL; | 221 using WebKit::WebIconURL; |
| 222 using WebKit::WebImage; | 222 using WebKit::WebImage; |
| 223 using WebKit::WebInputElement; | 223 using WebKit::WebInputElement; |
| 224 using WebKit::WebIntentRequest; | 224 using WebKit::WebIntentRequest; |
| 225 using WebKit::WebIntentServiceInfo; | 225 using WebKit::WebIntentServiceInfo; |
| 226 using WebKit::WebMediaPlayer; | 226 using WebKit::WebMediaPlayer; |
| 227 using WebKit::WebMediaPlayerAction; | 227 using WebKit::WebMediaPlayerAction; |
| 228 using WebKit::WebMediaPlayerClient; | 228 using WebKit::WebMediaPlayerClient; |
| 229 using WebKit::WebMouseEvent; |
| 229 using WebKit::WebNavigationPolicy; | 230 using WebKit::WebNavigationPolicy; |
| 230 using WebKit::WebNavigationType; | 231 using WebKit::WebNavigationType; |
| 231 using WebKit::WebNode; | 232 using WebKit::WebNode; |
| 232 using WebKit::WebPageSerializer; | 233 using WebKit::WebPageSerializer; |
| 233 using WebKit::WebPageSerializerClient; | 234 using WebKit::WebPageSerializerClient; |
| 234 using WebKit::WebPeerConnection00Handler; | 235 using WebKit::WebPeerConnection00Handler; |
| 235 using WebKit::WebPeerConnection00HandlerClient; | 236 using WebKit::WebPeerConnection00HandlerClient; |
| 236 using WebKit::WebPeerConnectionHandler; | 237 using WebKit::WebPeerConnectionHandler; |
| 237 using WebKit::WebPeerConnectionHandlerClient; | 238 using WebKit::WebPeerConnectionHandlerClient; |
| 238 using WebKit::WebPlugin; | 239 using WebKit::WebPlugin; |
| (...skipping 3107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3346 cached_is_main_frame_pinned_to_left_ = is_pinned_to_left; | 3347 cached_is_main_frame_pinned_to_left_ = is_pinned_to_left; |
| 3347 cached_is_main_frame_pinned_to_right_ = is_pinned_to_right; | 3348 cached_is_main_frame_pinned_to_right_ = is_pinned_to_right; |
| 3348 } | 3349 } |
| 3349 } | 3350 } |
| 3350 | 3351 |
| 3351 void RenderViewImpl::didChangeScrollOffset(WebFrame* frame) { | 3352 void RenderViewImpl::didChangeScrollOffset(WebFrame* frame) { |
| 3352 StartNavStateSyncTimerIfNecessary(); | 3353 StartNavStateSyncTimerIfNecessary(); |
| 3353 | 3354 |
| 3354 if (webview()->mainFrame() == frame) | 3355 if (webview()->mainFrame() == frame) |
| 3355 UpdateScrollState(frame); | 3356 UpdateScrollState(frame); |
| 3357 |
| 3358 FOR_EACH_OBSERVER( |
| 3359 RenderViewObserver, observers_, DidChangeScrollOffset(frame)); |
| 3356 } | 3360 } |
| 3357 | 3361 |
| 3358 void RenderViewImpl::numberOfWheelEventHandlersChanged(unsigned num_handlers) { | 3362 void RenderViewImpl::numberOfWheelEventHandlersChanged(unsigned num_handlers) { |
| 3359 Send(new ViewHostMsg_DidChangeNumWheelEvents(routing_id_, num_handlers)); | 3363 Send(new ViewHostMsg_DidChangeNumWheelEvents(routing_id_, num_handlers)); |
| 3360 } | 3364 } |
| 3361 | 3365 |
| 3362 void RenderViewImpl::numberOfTouchEventHandlersChanged(unsigned num_handlers) { | 3366 void RenderViewImpl::numberOfTouchEventHandlersChanged(unsigned num_handlers) { |
| 3363 Send(new ViewHostMsg_DidChangeNumTouchEvents(routing_id_, num_handlers)); | 3367 Send(new ViewHostMsg_DidChangeNumTouchEvents(routing_id_, num_handlers)); |
| 3364 } | 3368 } |
| 3365 | 3369 |
| (...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4740 } | 4744 } |
| 4741 | 4745 |
| 4742 bool RenderViewImpl::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 4746 bool RenderViewImpl::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
| 4743 pepper_delegate_.WillHandleMouseEvent(); | 4747 pepper_delegate_.WillHandleMouseEvent(); |
| 4744 | 4748 |
| 4745 // If the mouse is locked, only the current owner of the mouse lock can | 4749 // If the mouse is locked, only the current owner of the mouse lock can |
| 4746 // process mouse events. | 4750 // process mouse events. |
| 4747 return mouse_lock_dispatcher_->WillHandleMouseEvent(event); | 4751 return mouse_lock_dispatcher_->WillHandleMouseEvent(event); |
| 4748 } | 4752 } |
| 4749 | 4753 |
| 4750 void RenderViewImpl::DidHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 4754 void RenderViewImpl::DidHandleMouseEvent(const WebMouseEvent& event) { |
| 4751 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleMouseEvent(event)); | 4755 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleMouseEvent(event)); |
| 4752 } | 4756 } |
| 4753 | 4757 |
| 4754 void RenderViewImpl::DidHandleTouchEvent(const WebTouchEvent& event) { | 4758 void RenderViewImpl::DidHandleTouchEvent(const WebTouchEvent& event) { |
| 4755 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleTouchEvent(event)); | 4759 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleTouchEvent(event)); |
| 4756 } | 4760 } |
| 4757 | 4761 |
| 4758 void RenderViewImpl::OnWasHidden() { | 4762 void RenderViewImpl::OnWasHidden() { |
| 4759 RenderWidget::OnWasHidden(); | 4763 RenderWidget::OnWasHidden(); |
| 4760 | 4764 |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5115 int maximum_percent = static_cast<int>( | 5119 int maximum_percent = static_cast<int>( |
| 5116 WebView::zoomLevelToZoomFactor(maximum_level) * 100); | 5120 WebView::zoomLevelToZoomFactor(maximum_level) * 100); |
| 5117 | 5121 |
| 5118 Send(new ViewHostMsg_UpdateZoomLimits( | 5122 Send(new ViewHostMsg_UpdateZoomLimits( |
| 5119 routing_id_, minimum_percent, maximum_percent, remember)); | 5123 routing_id_, minimum_percent, maximum_percent, remember)); |
| 5120 } | 5124 } |
| 5121 | 5125 |
| 5122 void RenderViewImpl::zoomLevelChanged() { | 5126 void RenderViewImpl::zoomLevelChanged() { |
| 5123 bool remember = !webview()->mainFrame()->document().isPluginDocument(); | 5127 bool remember = !webview()->mainFrame()->document().isPluginDocument(); |
| 5124 float zoom_level = webview()->zoomLevel(); | 5128 float zoom_level = webview()->zoomLevel(); |
| 5129 |
| 5130 FOR_EACH_OBSERVER(RenderViewObserver, observers_, ZoomLevelChanged()); |
| 5131 |
| 5125 // Tell the browser which url got zoomed so it can update the menu and the | 5132 // Tell the browser which url got zoomed so it can update the menu and the |
| 5126 // saved values if necessary | 5133 // saved values if necessary |
| 5127 Send(new ViewHostMsg_DidZoomURL( | 5134 Send(new ViewHostMsg_DidZoomURL( |
| 5128 routing_id_, zoom_level, remember, | 5135 routing_id_, zoom_level, remember, |
| 5129 GURL(webview()->mainFrame()->document().url()))); | 5136 GURL(webview()->mainFrame()->document().url()))); |
| 5130 } | 5137 } |
| 5131 | 5138 |
| 5132 void RenderViewImpl::registerProtocolHandler(const WebString& scheme, | 5139 void RenderViewImpl::registerProtocolHandler(const WebString& scheme, |
| 5133 const WebString& base_url, | 5140 const WebString& base_url, |
| 5134 const WebString& url, | 5141 const WebString& url, |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5250 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5257 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
| 5251 return !!RenderThreadImpl::current()->compositor_thread(); | 5258 return !!RenderThreadImpl::current()->compositor_thread(); |
| 5252 } | 5259 } |
| 5253 | 5260 |
| 5254 void RenderViewImpl::OnJavaBridgeInit() { | 5261 void RenderViewImpl::OnJavaBridgeInit() { |
| 5255 DCHECK(!java_bridge_dispatcher_.get()); | 5262 DCHECK(!java_bridge_dispatcher_.get()); |
| 5256 #if defined(ENABLE_JAVA_BRIDGE) | 5263 #if defined(ENABLE_JAVA_BRIDGE) |
| 5257 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5264 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
| 5258 #endif | 5265 #endif |
| 5259 } | 5266 } |
| OLD | NEW |