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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h" | 130 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h" |
131 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h
" | 131 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h
" |
132 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba
cks.h" | 132 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba
cks.h" |
133 #include "third_party/WebKit/Source/WebKit/chromium/public/WebUserMediaClient.h" | 133 #include "third_party/WebKit/Source/WebKit/chromium/public/WebUserMediaClient.h" |
134 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 134 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
135 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" | 135 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" |
136 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h
" | 136 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h
" |
137 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebDragData.
h" | 137 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebDragData.
h" |
138 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC
ontext3D.h" | 138 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC
ontext3D.h" |
139 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h" | 139 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h" |
140 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ction00Handler.h" | |
141 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ction00HandlerClient.h" | |
142 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandler.h" | 140 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandler.h" |
143 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandlerClient.h" | 141 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandlerClient.h" |
144 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" | 142 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" |
145 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 143 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
146 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | 144 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
147 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSocketStr
eamHandle.h" | 145 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSocketStr
eamHandle.h" |
148 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 146 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
149 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 147 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
150 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.
h" | 148 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.
h" |
151 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" | 149 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 using WebKit::WebIntentRequest; | 221 using WebKit::WebIntentRequest; |
224 using WebKit::WebIntentServiceInfo; | 222 using WebKit::WebIntentServiceInfo; |
225 using WebKit::WebMediaPlayer; | 223 using WebKit::WebMediaPlayer; |
226 using WebKit::WebMediaPlayerAction; | 224 using WebKit::WebMediaPlayerAction; |
227 using WebKit::WebMediaPlayerClient; | 225 using WebKit::WebMediaPlayerClient; |
228 using WebKit::WebNavigationPolicy; | 226 using WebKit::WebNavigationPolicy; |
229 using WebKit::WebNavigationType; | 227 using WebKit::WebNavigationType; |
230 using WebKit::WebNode; | 228 using WebKit::WebNode; |
231 using WebKit::WebPageSerializer; | 229 using WebKit::WebPageSerializer; |
232 using WebKit::WebPageSerializerClient; | 230 using WebKit::WebPageSerializerClient; |
233 using WebKit::WebPeerConnection00Handler; | |
234 using WebKit::WebPeerConnection00HandlerClient; | |
235 using WebKit::WebPeerConnectionHandler; | |
236 using WebKit::WebPeerConnectionHandlerClient; | |
237 using WebKit::WebPlugin; | 231 using WebKit::WebPlugin; |
238 using WebKit::WebPluginAction; | 232 using WebKit::WebPluginAction; |
239 using WebKit::WebPluginContainer; | 233 using WebKit::WebPluginContainer; |
240 using WebKit::WebPluginDocument; | 234 using WebKit::WebPluginDocument; |
241 using WebKit::WebPluginParams; | 235 using WebKit::WebPluginParams; |
242 using WebKit::WebPoint; | 236 using WebKit::WebPoint; |
243 using WebKit::WebPopupMenuInfo; | 237 using WebKit::WebPopupMenuInfo; |
244 using WebKit::WebRange; | 238 using WebKit::WebRange; |
245 using WebKit::WebRect; | 239 using WebKit::WebRect; |
246 using WebKit::WebReferrerPolicy; | 240 using WebKit::WebReferrerPolicy; |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 counter, | 637 counter, |
644 routing_id, | 638 routing_id, |
645 surface_id, | 639 surface_id, |
646 session_storage_namespace_id, | 640 session_storage_namespace_id, |
647 frame_name, | 641 frame_name, |
648 next_page_id, | 642 next_page_id, |
649 screen_info, | 643 screen_info, |
650 guest); | 644 guest); |
651 } | 645 } |
652 | 646 |
653 WebPeerConnectionHandler* RenderViewImpl::CreatePeerConnectionHandler( | 647 WebKit::WebPeerConnectionHandler* RenderViewImpl::CreatePeerConnectionHandler( |
654 WebPeerConnectionHandlerClient* client) { | 648 WebKit::WebPeerConnectionHandlerClient* client) { |
| 649 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 650 if (!cmd_line->HasSwitch(switches::kEnableMediaStream)) |
| 651 return NULL; |
655 EnsureMediaStreamImpl(); | 652 EnsureMediaStreamImpl(); |
656 if (!media_stream_impl_.get()) | 653 if (!media_stream_impl_.get()) |
657 return NULL; | 654 return NULL; |
658 return media_stream_impl_->CreatePeerConnectionHandler(client); | 655 return media_stream_impl_->CreatePeerConnectionHandler(client); |
659 } | 656 } |
660 | 657 |
661 WebPeerConnection00Handler* RenderViewImpl::CreatePeerConnectionHandlerJsep( | |
662 WebPeerConnection00HandlerClient* client) { | |
663 EnsureMediaStreamImpl(); | |
664 if (!media_stream_impl_.get()) | |
665 return NULL; | |
666 return media_stream_impl_->CreatePeerConnectionHandlerJsep(client); | |
667 } | |
668 | |
669 void RenderViewImpl::AddObserver(RenderViewObserver* observer) { | 658 void RenderViewImpl::AddObserver(RenderViewObserver* observer) { |
670 observers_.AddObserver(observer); | 659 observers_.AddObserver(observer); |
671 } | 660 } |
672 | 661 |
673 void RenderViewImpl::RemoveObserver(RenderViewObserver* observer) { | 662 void RenderViewImpl::RemoveObserver(RenderViewObserver* observer) { |
674 observer->RenderViewGone(); | 663 observer->RenderViewGone(); |
675 observers_.RemoveObserver(observer); | 664 observers_.RemoveObserver(observer); |
676 } | 665 } |
677 | 666 |
678 WebKit::WebView* RenderViewImpl::webview() const { | 667 WebKit::WebView* RenderViewImpl::webview() const { |
(...skipping 2601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3280 | 3269 |
3281 if (size == preferred_size_) | 3270 if (size == preferred_size_) |
3282 return; | 3271 return; |
3283 | 3272 |
3284 preferred_size_ = size; | 3273 preferred_size_ = size; |
3285 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, | 3274 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, |
3286 preferred_size_)); | 3275 preferred_size_)); |
3287 } | 3276 } |
3288 | 3277 |
3289 void RenderViewImpl::EnsureMediaStreamImpl() { | 3278 void RenderViewImpl::EnsureMediaStreamImpl() { |
3290 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | |
3291 if (!cmd_line->HasSwitch(switches::kEnableMediaStream)) | |
3292 return; | |
3293 | |
3294 #if defined(ENABLE_P2P_APIS) | 3279 #if defined(ENABLE_P2P_APIS) |
3295 if (!p2p_socket_dispatcher_) | 3280 if (!p2p_socket_dispatcher_) |
3296 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); | 3281 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); |
3297 #endif | 3282 #endif |
3298 | 3283 |
3299 #if defined(ENABLE_WEBRTC) | 3284 #if defined(ENABLE_WEBRTC) |
3300 if (!media_stream_dispatcher_) | 3285 if (!media_stream_dispatcher_) |
3301 media_stream_dispatcher_ = new MediaStreamDispatcher(this); | 3286 media_stream_dispatcher_ = new MediaStreamDispatcher(this); |
3302 | 3287 |
3303 if (!media_stream_impl_.get()) { | 3288 if (!media_stream_impl_.get()) { |
(...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5152 WebKit::WebPageVisibilityStateVisible; | 5137 WebKit::WebPageVisibilityStateVisible; |
5153 WebKit::WebPageVisibilityState override_state = current_state; | 5138 WebKit::WebPageVisibilityState override_state = current_state; |
5154 if (content::GetContentClient()->renderer()-> | 5139 if (content::GetContentClient()->renderer()-> |
5155 ShouldOverridePageVisibilityState(this, | 5140 ShouldOverridePageVisibilityState(this, |
5156 &override_state)) | 5141 &override_state)) |
5157 return override_state; | 5142 return override_state; |
5158 return current_state; | 5143 return current_state; |
5159 } | 5144 } |
5160 | 5145 |
5161 WebKit::WebUserMediaClient* RenderViewImpl::userMediaClient() { | 5146 WebKit::WebUserMediaClient* RenderViewImpl::userMediaClient() { |
| 5147 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 5148 if (!cmd_line->HasSwitch(switches::kEnableMediaStream)) |
| 5149 return NULL; |
5162 EnsureMediaStreamImpl(); | 5150 EnsureMediaStreamImpl(); |
5163 return media_stream_impl_; | 5151 return media_stream_impl_; |
5164 } | 5152 } |
5165 | 5153 |
5166 bool RenderViewImpl::IsNonLocalTopLevelNavigation( | 5154 bool RenderViewImpl::IsNonLocalTopLevelNavigation( |
5167 const GURL& url, WebKit::WebFrame* frame, WebKit::WebNavigationType type) { | 5155 const GURL& url, WebKit::WebFrame* frame, WebKit::WebNavigationType type) { |
5168 // Must be a top level frame. | 5156 // Must be a top level frame. |
5169 if (frame->parent() != NULL) | 5157 if (frame->parent() != NULL) |
5170 return false; | 5158 return false; |
5171 | 5159 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5252 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5240 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5253 return !!RenderThreadImpl::current()->compositor_thread(); | 5241 return !!RenderThreadImpl::current()->compositor_thread(); |
5254 } | 5242 } |
5255 | 5243 |
5256 void RenderViewImpl::OnJavaBridgeInit() { | 5244 void RenderViewImpl::OnJavaBridgeInit() { |
5257 DCHECK(!java_bridge_dispatcher_.get()); | 5245 DCHECK(!java_bridge_dispatcher_.get()); |
5258 #if defined(ENABLE_JAVA_BRIDGE) | 5246 #if defined(ENABLE_JAVA_BRIDGE) |
5259 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5247 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
5260 #endif | 5248 #endif |
5261 } | 5249 } |
OLD | NEW |