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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
497 | 497 |
498 OnSetRendererPrefs(renderer_prefs); | 498 OnSetRendererPrefs(renderer_prefs); |
499 | 499 |
500 host_window_ = parent_hwnd; | 500 host_window_ = parent_hwnd; |
501 | 501 |
502 #if defined(ENABLE_P2P_APIS) | 502 #if defined(ENABLE_P2P_APIS) |
503 if (!p2p_socket_dispatcher_) | 503 if (!p2p_socket_dispatcher_) |
504 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); | 504 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); |
505 #endif | 505 #endif |
506 | 506 |
507 if (!media_stream_dispatcher_) | 507 if (!media_stream_dispatcher_) |
Satish
2012/02/09 13:09:55
Also need to wrap these two lines in #if defined(E
wjia(left Chromium)
2012/02/09 18:20:52
Done.
| |
508 media_stream_dispatcher_ = new MediaStreamDispatcher(this); | 508 media_stream_dispatcher_ = new MediaStreamDispatcher(this); |
509 | 509 |
510 new MHTMLGenerator(this); | 510 new MHTMLGenerator(this); |
511 #if defined(OS_MACOSX) | 511 #if defined(OS_MACOSX) |
512 new TextInputClientObserver(this); | 512 new TextInputClientObserver(this); |
513 #endif // defined(OS_MACOSX) | 513 #endif // defined(OS_MACOSX) |
514 | 514 |
515 // The next group of objects all implement RenderViewObserver, so are deleted | 515 // The next group of objects all implement RenderViewObserver, so are deleted |
516 // along with the RenderView automatically. | 516 // along with the RenderView automatically. |
517 devtools_agent_ = new DevToolsAgent(this); | 517 devtools_agent_ = new DevToolsAgent(this); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
615 frame_name, | 615 frame_name, |
616 next_page_id); // adds reference | 616 next_page_id); // adds reference |
617 } | 617 } |
618 | 618 |
619 WebKit::WebPeerConnectionHandler* RenderViewImpl::CreatePeerConnectionHandler( | 619 WebKit::WebPeerConnectionHandler* RenderViewImpl::CreatePeerConnectionHandler( |
620 WebKit::WebPeerConnectionHandlerClient* client) { | 620 WebKit::WebPeerConnectionHandlerClient* client) { |
621 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 621 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
622 if (!cmd_line->HasSwitch(switches::kEnableMediaStream)) | 622 if (!cmd_line->HasSwitch(switches::kEnableMediaStream)) |
623 return NULL; | 623 return NULL; |
624 EnsureMediaStreamImpl(); | 624 EnsureMediaStreamImpl(); |
625 if (!media_stream_impl_.get()) | |
626 return NULL; | |
625 return media_stream_impl_->CreatePeerConnectionHandler(client); | 627 return media_stream_impl_->CreatePeerConnectionHandler(client); |
626 } | 628 } |
627 | 629 |
628 void RenderViewImpl::AddObserver(RenderViewObserver* observer) { | 630 void RenderViewImpl::AddObserver(RenderViewObserver* observer) { |
629 observers_.AddObserver(observer); | 631 observers_.AddObserver(observer); |
630 } | 632 } |
631 | 633 |
632 void RenderViewImpl::RemoveObserver(RenderViewObserver* observer) { | 634 void RenderViewImpl::RemoveObserver(RenderViewObserver* observer) { |
633 observer->RenderViewGone(); | 635 observer->RenderViewGone(); |
634 observers_.RemoveObserver(observer); | 636 observers_.RemoveObserver(observer); |
(...skipping 2504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3139 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, | 3141 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, |
3140 preferred_size_)); | 3142 preferred_size_)); |
3141 } | 3143 } |
3142 | 3144 |
3143 void RenderViewImpl::EnsureMediaStreamImpl() { | 3145 void RenderViewImpl::EnsureMediaStreamImpl() { |
3144 #if defined(ENABLE_P2P_APIS) | 3146 #if defined(ENABLE_P2P_APIS) |
3145 if (!p2p_socket_dispatcher_) | 3147 if (!p2p_socket_dispatcher_) |
3146 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); | 3148 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); |
3147 #endif | 3149 #endif |
3148 | 3150 |
3151 #if defined(ENABLE_WEBRTC) | |
3149 if (!media_stream_dispatcher_) | 3152 if (!media_stream_dispatcher_) |
3150 media_stream_dispatcher_ = new MediaStreamDispatcher(this); | 3153 media_stream_dispatcher_ = new MediaStreamDispatcher(this); |
3151 | 3154 |
3152 if (!media_stream_impl_.get()) { | 3155 if (!media_stream_impl_.get()) { |
3153 MediaStreamDependencyFactory* factory = new MediaStreamDependencyFactory(); | 3156 MediaStreamDependencyFactory* factory = new MediaStreamDependencyFactory(); |
3154 media_stream_impl_ = new MediaStreamImpl( | 3157 media_stream_impl_ = new MediaStreamImpl( |
3155 media_stream_dispatcher_, | 3158 media_stream_dispatcher_, |
3156 p2p_socket_dispatcher_, | 3159 p2p_socket_dispatcher_, |
3157 RenderThreadImpl::current()->video_capture_impl_manager(), | 3160 RenderThreadImpl::current()->video_capture_impl_manager(), |
3158 factory); | 3161 factory); |
3159 } | 3162 } |
3163 #endif | |
3160 } | 3164 } |
3161 | 3165 |
3162 void RenderViewImpl::didChangeContentsSize(WebFrame* frame, | 3166 void RenderViewImpl::didChangeContentsSize(WebFrame* frame, |
3163 const WebSize& size) { | 3167 const WebSize& size) { |
3164 if (webview()->mainFrame() != frame) | 3168 if (webview()->mainFrame() != frame) |
3165 return; | 3169 return; |
3166 WebView* frameView = frame->view(); | 3170 WebView* frameView = frame->view(); |
3167 if (!frameView) | 3171 if (!frameView) |
3168 return; | 3172 return; |
3169 | 3173 |
(...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5028 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5032 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5029 return !!RenderThreadImpl::current()->compositor_thread(); | 5033 return !!RenderThreadImpl::current()->compositor_thread(); |
5030 } | 5034 } |
5031 | 5035 |
5032 void RenderViewImpl::OnJavaBridgeInit() { | 5036 void RenderViewImpl::OnJavaBridgeInit() { |
5033 DCHECK(!java_bridge_dispatcher_.get()); | 5037 DCHECK(!java_bridge_dispatcher_.get()); |
5034 #if defined(ENABLE_JAVA_BRIDGE) | 5038 #if defined(ENABLE_JAVA_BRIDGE) |
5035 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5039 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
5036 #endif | 5040 #endif |
5037 } | 5041 } |
OLD | NEW |