| 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 media_stream_dispatcher_(NULL), | 373 media_stream_dispatcher_(NULL), |
| 374 p2p_socket_dispatcher_(NULL), | 374 p2p_socket_dispatcher_(NULL), |
| 375 devtools_agent_(NULL), | 375 devtools_agent_(NULL), |
| 376 renderer_accessibility_(NULL), | 376 renderer_accessibility_(NULL), |
| 377 session_storage_namespace_id_(session_storage_namespace_id), | 377 session_storage_namespace_id_(session_storage_namespace_id), |
| 378 handling_select_range_(false), | 378 handling_select_range_(false), |
| 379 #if defined(OS_WIN) | 379 #if defined(OS_WIN) |
| 380 focused_plugin_id_(-1), | 380 focused_plugin_id_(-1), |
| 381 #endif | 381 #endif |
| 382 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) { | 382 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) { |
| 383 printf("wwwwwwwwwwwwww RenderViewImpl::RenderViewImpl() called 1, %p\n", media_s
tream_dispatcher()); |
| 383 routing_id_ = routing_id; | 384 routing_id_ = routing_id; |
| 384 surface_id_ = surface_id; | 385 surface_id_ = surface_id; |
| 385 if (opener_id != MSG_ROUTING_NONE) | 386 if (opener_id != MSG_ROUTING_NONE) |
| 386 opener_id_ = opener_id; | 387 opener_id_ = opener_id; |
| 387 | 388 |
| 388 // Ensure we start with a valid next_page_id_ from the browser. | 389 // Ensure we start with a valid next_page_id_ from the browser. |
| 389 DCHECK_GE(next_page_id_, 0); | 390 DCHECK_GE(next_page_id_, 0); |
| 390 | 391 |
| 391 #if defined(ENABLE_NOTIFICATIONS) | 392 #if defined(ENABLE_NOTIFICATIONS) |
| 392 notification_provider_ = new NotificationProvider(this); | 393 notification_provider_ = new NotificationProvider(this); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 431 |
| 431 OnSetRendererPrefs(renderer_prefs); | 432 OnSetRendererPrefs(renderer_prefs); |
| 432 | 433 |
| 433 host_window_ = parent_hwnd; | 434 host_window_ = parent_hwnd; |
| 434 | 435 |
| 435 #if defined(ENABLE_P2P_APIS) | 436 #if defined(ENABLE_P2P_APIS) |
| 436 if (!p2p_socket_dispatcher_) | 437 if (!p2p_socket_dispatcher_) |
| 437 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); | 438 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); |
| 438 #endif | 439 #endif |
| 439 | 440 |
| 441 printf("wwwwwwwwwwwwww RenderViewImpl::RenderViewImpl() called 2, %p\n", media_s
tream_dispatcher()); |
| 442 if (!media_stream_dispatcher_) |
| 443 media_stream_dispatcher_ = new MediaStreamDispatcher(this); |
| 444 printf("wwwwwwwwwwwwww RenderViewImpl::RenderViewImpl() called 3, %p\n", media_s
tream_dispatcher()); |
| 445 |
| 440 new MHTMLGenerator(this); | 446 new MHTMLGenerator(this); |
| 441 #if defined(OS_MACOSX) | 447 #if defined(OS_MACOSX) |
| 442 new TextInputClientObserver(this); | 448 new TextInputClientObserver(this); |
| 443 #endif // defined(OS_MACOSX) | 449 #endif // defined(OS_MACOSX) |
| 444 | 450 |
| 445 devtools_agent_ = new DevToolsAgent(this); | 451 devtools_agent_ = new DevToolsAgent(this); |
| 446 | 452 |
| 447 renderer_accessibility_ = new RendererAccessibility(this); | 453 renderer_accessibility_ = new RendererAccessibility(this); |
| 448 | 454 |
| 449 new IdleUserDetector(this); | 455 new IdleUserDetector(this); |
| (...skipping 2574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3024 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, | 3030 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, |
| 3025 preferred_size_)); | 3031 preferred_size_)); |
| 3026 } | 3032 } |
| 3027 | 3033 |
| 3028 void RenderViewImpl::EnsureMediaStreamImpl() { | 3034 void RenderViewImpl::EnsureMediaStreamImpl() { |
| 3029 #if defined(ENABLE_P2P_APIS) | 3035 #if defined(ENABLE_P2P_APIS) |
| 3030 if (!p2p_socket_dispatcher_) | 3036 if (!p2p_socket_dispatcher_) |
| 3031 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); | 3037 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); |
| 3032 #endif | 3038 #endif |
| 3033 | 3039 |
| 3040 printf("wwwwwwwwwwwwww RenderViewImpl::EnsureMediaStreamImpl() called 1, %p\n",
media_stream_dispatcher()); |
| 3034 if (!media_stream_dispatcher_) | 3041 if (!media_stream_dispatcher_) |
| 3035 media_stream_dispatcher_ = new MediaStreamDispatcher(this); | 3042 media_stream_dispatcher_ = new MediaStreamDispatcher(this); |
| 3043 printf("wwwwwwwwwwwwww RenderViewImpl::EnsureMediaStreamImpl() called 2, %p\n",
media_stream_dispatcher()); |
| 3036 | 3044 |
| 3037 if (!media_stream_impl_.get()) { | 3045 if (!media_stream_impl_.get()) { |
| 3038 MediaStreamDependencyFactory* factory = new MediaStreamDependencyFactory(); | 3046 MediaStreamDependencyFactory* factory = new MediaStreamDependencyFactory(); |
| 3039 media_stream_impl_ = new MediaStreamImpl( | 3047 media_stream_impl_ = new MediaStreamImpl( |
| 3040 media_stream_dispatcher_, | 3048 media_stream_dispatcher_, |
| 3041 p2p_socket_dispatcher_, | 3049 p2p_socket_dispatcher_, |
| 3042 RenderThreadImpl::current()->video_capture_impl_manager(), | 3050 RenderThreadImpl::current()->video_capture_impl_manager(), |
| 3043 factory); | 3051 factory); |
| 3044 } | 3052 } |
| 3045 } | 3053 } |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3580 } | 3588 } |
| 3581 | 3589 |
| 3582 WebKit::WebPlugin* RenderViewImpl::GetWebPluginFromPluginDocument() { | 3590 WebKit::WebPlugin* RenderViewImpl::GetWebPluginFromPluginDocument() { |
| 3583 return webview()->mainFrame()->document().to<WebPluginDocument>().plugin(); | 3591 return webview()->mainFrame()->document().to<WebPluginDocument>().plugin(); |
| 3584 } | 3592 } |
| 3585 | 3593 |
| 3586 void RenderViewImpl::OnFind(int request_id, const string16& search_text, | 3594 void RenderViewImpl::OnFind(int request_id, const string16& search_text, |
| 3587 const WebFindOptions& options) { | 3595 const WebFindOptions& options) { |
| 3588 WebFrame* main_frame = webview()->mainFrame(); | 3596 WebFrame* main_frame = webview()->mainFrame(); |
| 3589 | 3597 |
| 3598 // This is for testing. Remove!!! |
| 3599 //////////////////////////////////// |
| 3600 std::string line = UTF16ToUTF8(search_text); |
| 3601 if (StartsWithASCII(line, "small", false)) { |
| 3602 printf("OnFind start to enumerate video devices ...\n"); |
| 3603 media_stream_impl_->GetVideoDevice(0); |
| 3604 } else if (StartsWithASCII(line, "large", false)) { |
| 3605 printf("OnFind start to enumerate video devices ...\n"); |
| 3606 media_stream_impl_->GetVideoDevice(1); |
| 3607 } |
| 3608 //////////////////////////////////// |
| 3609 |
| 3590 // Check if the plugin still exists in the document. | 3610 // Check if the plugin still exists in the document. |
| 3591 if (main_frame->document().isPluginDocument() && | 3611 if (main_frame->document().isPluginDocument() && |
| 3592 GetWebPluginFromPluginDocument()) { | 3612 GetWebPluginFromPluginDocument()) { |
| 3593 if (options.findNext) { | 3613 if (options.findNext) { |
| 3594 // Just navigate back/forward. | 3614 // Just navigate back/forward. |
| 3595 GetWebPluginFromPluginDocument()->selectFindResult(options.forward); | 3615 GetWebPluginFromPluginDocument()->selectFindResult(options.forward); |
| 3596 } else { | 3616 } else { |
| 3597 if (GetWebPluginFromPluginDocument()->startFind( | 3617 if (GetWebPluginFromPluginDocument()->startFind( |
| 3598 search_text, options.matchCase, request_id)) { | 3618 search_text, options.matchCase, request_id)) { |
| 3599 } else { | 3619 } else { |
| (...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4912 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4932 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
| 4913 return !!RenderThreadImpl::current()->compositor_thread(); | 4933 return !!RenderThreadImpl::current()->compositor_thread(); |
| 4914 } | 4934 } |
| 4915 | 4935 |
| 4916 void RenderViewImpl::OnJavaBridgeInit() { | 4936 void RenderViewImpl::OnJavaBridgeInit() { |
| 4917 DCHECK(!java_bridge_dispatcher_.get()); | 4937 DCHECK(!java_bridge_dispatcher_.get()); |
| 4918 #if defined(ENABLE_JAVA_BRIDGE) | 4938 #if defined(ENABLE_JAVA_BRIDGE) |
| 4919 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 4939 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
| 4920 #endif | 4940 #endif |
| 4921 } | 4941 } |
| OLD | NEW |