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