Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 #include "content/renderer/device_orientation_dispatcher.h" | 51 #include "content/renderer/device_orientation_dispatcher.h" |
| 52 #include "content/renderer/devtools_agent.h" | 52 #include "content/renderer/devtools_agent.h" |
| 53 #include "content/renderer/external_popup_menu.h" | 53 #include "content/renderer/external_popup_menu.h" |
| 54 #include "content/renderer/geolocation_dispatcher.h" | 54 #include "content/renderer/geolocation_dispatcher.h" |
| 55 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 55 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
| 56 #include "content/renderer/intents_dispatcher.h" | 56 #include "content/renderer/intents_dispatcher.h" |
| 57 #include "content/renderer/java/java_bridge_dispatcher.h" | 57 #include "content/renderer/java/java_bridge_dispatcher.h" |
| 58 #include "content/renderer/load_progress_tracker.h" | 58 #include "content/renderer/load_progress_tracker.h" |
| 59 #include "content/renderer/media/audio_message_filter.h" | 59 #include "content/renderer/media/audio_message_filter.h" |
| 60 #include "content/renderer/media/audio_renderer_impl.h" | 60 #include "content/renderer/media/audio_renderer_impl.h" |
| 61 #include "content/renderer/media/media_stream_dependency_factory.h" | |
| 62 #include "content/renderer/media/media_stream_dispatcher.h" | |
| 61 #include "content/renderer/media/media_stream_impl.h" | 63 #include "content/renderer/media/media_stream_impl.h" |
| 62 #include "content/renderer/media/render_media_log.h" | 64 #include "content/renderer/media/render_media_log.h" |
| 63 #include "content/renderer/mhtml_generator.h" | 65 #include "content/renderer/mhtml_generator.h" |
| 64 #include "content/renderer/notification_provider.h" | 66 #include "content/renderer/notification_provider.h" |
| 65 #include "content/renderer/p2p/socket_dispatcher.h" | 67 #include "content/renderer/p2p/socket_dispatcher.h" |
| 66 #include "content/renderer/plugin_channel_host.h" | 68 #include "content/renderer/plugin_channel_host.h" |
| 67 #include "content/renderer/render_process.h" | 69 #include "content/renderer/render_process.h" |
| 68 #include "content/renderer/render_thread_impl.h" | 70 #include "content/renderer/render_thread_impl.h" |
| 69 #include "content/renderer/render_widget_fullscreen_pepper.h" | 71 #include "content/renderer/render_widget_fullscreen_pepper.h" |
| 70 #include "content/renderer/renderer_accessibility.h" | 72 #include "content/renderer/renderer_accessibility.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 96 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" | 98 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" |
| 97 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 99 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 98 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGraphicsContext3D. h" | 100 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGraphicsContext3D. h" |
| 99 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" | 101 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" |
| 100 #include "third_party/WebKit/Source/WebKit/chromium/public/WebImage.h" | 102 #include "third_party/WebKit/Source/WebKit/chromium/public/WebImage.h" |
| 101 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" | 103 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" |
| 102 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 104 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 103 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction. h" | 105 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction. h" |
| 104 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeList.h" | 106 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeList.h" |
| 105 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializer.h" | 107 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializer.h" |
| 108 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPeerConnectionHand ler.h" | |
| 109 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPeerConnectionHand lerClient.h" | |
| 106 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" | 110 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" |
| 107 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 111 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
| 108 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginDocument.h" | 112 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginDocument.h" |
| 109 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" | 113 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" |
| 110 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h" | 114 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h" |
| 111 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" | 115 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" |
| 112 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" | 116 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" |
| 113 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" | 117 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" |
| 114 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSearchableFormData .h" | 118 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSearchableFormData .h" |
| 115 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 119 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
| 116 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" | 120 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" |
| 117 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h" | 121 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h" |
| 118 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" | 122 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" |
| 119 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h " | 123 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h " |
| 120 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba cks.h" | 124 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba cks.h" |
| 121 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 125 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
| 122 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" | 126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" |
| 123 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" | 127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" |
| 124 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 128 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
| 125 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" | 129 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" |
| 130 #include "third_party/WebKit/Source/WebKit/chromium/public/WebUserMediaClient.h" | |
| 126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" | 131 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" |
| 127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 132 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 128 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" | 133 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" |
| 129 #include "third_party/skia/include/core/SkBitmap.h" | 134 #include "third_party/skia/include/core/SkBitmap.h" |
| 130 #include "ui/base/message_box_flags.h" | 135 #include "ui/base/message_box_flags.h" |
| 131 #include "ui/gfx/native_widget_types.h" | 136 #include "ui/gfx/native_widget_types.h" |
| 132 #include "ui/gfx/point.h" | 137 #include "ui/gfx/point.h" |
| 133 #include "ui/gfx/rect.h" | 138 #include "ui/gfx/rect.h" |
| 134 #include "v8/include/v8.h" | 139 #include "v8/include/v8.h" |
| 135 #include "webkit/appcache/web_application_cache_host_impl.h" | 140 #include "webkit/appcache/web_application_cache_host_impl.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 cached_has_main_frame_horizontal_scrollbar_(false), | 349 cached_has_main_frame_horizontal_scrollbar_(false), |
| 345 cached_has_main_frame_vertical_scrollbar_(false), | 350 cached_has_main_frame_vertical_scrollbar_(false), |
| 346 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)), | 351 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)), |
| 347 #if defined(OS_WIN) | 352 #if defined(OS_WIN) |
| 348 focused_plugin_id_(-1), | 353 focused_plugin_id_(-1), |
| 349 #endif | 354 #endif |
| 350 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), | 355 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), |
| 351 geolocation_dispatcher_(NULL), | 356 geolocation_dispatcher_(NULL), |
| 352 speech_input_dispatcher_(NULL), | 357 speech_input_dispatcher_(NULL), |
| 353 device_orientation_dispatcher_(NULL), | 358 device_orientation_dispatcher_(NULL), |
| 359 media_stream_dispatcher_(NULL), | |
| 354 p2p_socket_dispatcher_(NULL), | 360 p2p_socket_dispatcher_(NULL), |
| 355 devtools_agent_(NULL), | 361 devtools_agent_(NULL), |
| 356 renderer_accessibility_(NULL), | 362 renderer_accessibility_(NULL), |
| 357 session_storage_namespace_id_(session_storage_namespace_id), | 363 session_storage_namespace_id_(session_storage_namespace_id), |
| 358 handling_select_range_(false) { | 364 handling_select_range_(false) { |
| 359 routing_id_ = routing_id; | 365 routing_id_ = routing_id; |
| 360 if (opener_id != MSG_ROUTING_NONE) | 366 if (opener_id != MSG_ROUTING_NONE) |
| 361 opener_id_ = opener_id; | 367 opener_id_ = opener_id; |
| 362 | 368 |
| 363 webwidget_ = WebView::create(this); | 369 webwidget_ = WebView::create(this); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 398 webview()->mainFrame()->setName(frame_name); | 404 webview()->mainFrame()->setName(frame_name); |
| 399 webview()->settings()->setMinimumTimerInterval( | 405 webview()->settings()->setMinimumTimerInterval( |
| 400 is_hidden() ? webkit_glue::kBackgroundTabTimerInterval : | 406 is_hidden() ? webkit_glue::kBackgroundTabTimerInterval : |
| 401 webkit_glue::kForegroundTabTimerInterval); | 407 webkit_glue::kForegroundTabTimerInterval); |
| 402 | 408 |
| 403 OnSetRendererPrefs(renderer_prefs); | 409 OnSetRendererPrefs(renderer_prefs); |
| 404 | 410 |
| 405 host_window_ = parent_hwnd; | 411 host_window_ = parent_hwnd; |
| 406 | 412 |
| 407 #if defined(ENABLE_P2P_APIS) | 413 #if defined(ENABLE_P2P_APIS) |
| 408 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); | 414 if (!p2p_socket_dispatcher_) |
| 415 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); | |
| 409 #endif | 416 #endif |
| 410 | 417 |
| 411 new MHTMLGenerator(this); | 418 new MHTMLGenerator(this); |
| 412 #if defined(OS_MACOSX) | 419 #if defined(OS_MACOSX) |
| 413 new TextInputClientObserver(this); | 420 new TextInputClientObserver(this); |
| 414 #endif // defined(OS_MACOSX) | 421 #endif // defined(OS_MACOSX) |
| 415 | 422 |
| 416 devtools_agent_ = new DevToolsAgent(this); | 423 devtools_agent_ = new DevToolsAgent(this); |
| 417 | 424 |
| 418 renderer_accessibility_ = new RendererAccessibility(this); | 425 renderer_accessibility_ = new RendererAccessibility(this); |
| 419 | 426 |
| 420 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
| 421 if (command_line.HasSwitch(switches::kEnableMediaStream)) { | |
| 422 media_stream_impl_ = new MediaStreamImpl( | |
| 423 RenderThreadImpl::current()->video_capture_impl_manager()); | |
| 424 } | |
| 425 | |
| 426 content::GetContentClient()->renderer()->RenderViewCreated(this); | 427 content::GetContentClient()->renderer()->RenderViewCreated(this); |
| 427 } | 428 } |
| 428 | 429 |
| 429 RenderViewImpl::~RenderViewImpl() { | 430 RenderViewImpl::~RenderViewImpl() { |
| 430 history_page_ids_.clear(); | 431 history_page_ids_.clear(); |
| 431 | 432 |
| 432 if (decrement_shared_popup_at_destruction_) | 433 if (decrement_shared_popup_at_destruction_) |
| 433 shared_popup_counter_->data--; | 434 shared_popup_counter_->data--; |
| 434 | 435 |
| 435 // If file chooser is still waiting for answer, dispatch empty answer. | 436 // If file chooser is still waiting for answer, dispatch empty answer. |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 451 } | 452 } |
| 452 #endif | 453 #endif |
| 453 | 454 |
| 454 #ifndef NDEBUG | 455 #ifndef NDEBUG |
| 455 // Make sure we are no longer referenced by the ViewMap. | 456 // Make sure we are no longer referenced by the ViewMap. |
| 456 ViewMap* views = g_view_map.Pointer(); | 457 ViewMap* views = g_view_map.Pointer(); |
| 457 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) | 458 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) |
| 458 DCHECK_NE(this, it->second) << "Failed to call Close?"; | 459 DCHECK_NE(this, it->second) << "Failed to call Close?"; |
| 459 #endif | 460 #endif |
| 460 | 461 |
| 462 // MediaStreamImpl holds weak references to RenderViewObserver objects, | |
| 463 // ensure it's deleted before the observers. | |
| 464 media_stream_impl_ = NULL; | |
| 465 | |
| 461 FOR_EACH_OBSERVER(RenderViewObserver, observers_, RenderViewGone()); | 466 FOR_EACH_OBSERVER(RenderViewObserver, observers_, RenderViewGone()); |
| 462 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnDestruct()); | 467 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnDestruct()); |
| 463 } | 468 } |
| 464 | 469 |
| 465 /*static*/ | 470 /*static*/ |
| 466 RenderViewImpl* RenderViewImpl::FromWebView(WebView* webview) { | 471 RenderViewImpl* RenderViewImpl::FromWebView(WebView* webview) { |
| 467 ViewMap* views = g_view_map.Pointer(); | 472 ViewMap* views = g_view_map.Pointer(); |
| 468 ViewMap::iterator it = views->find(webview); | 473 ViewMap::iterator it = views->find(webview); |
| 469 return it == views->end() ? NULL : it->second; | 474 return it == views->end() ? NULL : it->second; |
| 470 } | 475 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 509 // static | 514 // static |
| 510 void RenderViewImpl::SetNextPageID(int32 next_page_id) { | 515 void RenderViewImpl::SetNextPageID(int32 next_page_id) { |
| 511 // This method is called on startup or when the browser knows it needs to | 516 // This method is called on startup or when the browser knows it needs to |
| 512 // inflate the page_id when re-using the process. The renderer may have | 517 // inflate the page_id when re-using the process. The renderer may have |
| 513 // incremented this just as the browser was sending the message, but we | 518 // incremented this just as the browser was sending the message, but we |
| 514 // only care that next_page_id_ is at least as large as next_page_id. | 519 // only care that next_page_id_ is at least as large as next_page_id. |
| 515 if (next_page_id > next_page_id_) | 520 if (next_page_id > next_page_id_) |
| 516 next_page_id_ = next_page_id; | 521 next_page_id_ = next_page_id; |
| 517 } | 522 } |
| 518 | 523 |
| 524 WebKit::WebPeerConnectionHandler* RenderViewImpl::CreatePeerConnectionHandler( | |
| 525 WebKit::WebPeerConnectionHandlerClient* client) { | |
| 526 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | |
| 527 if (!cmd_line->HasSwitch(switches::kEnableMediaStream)) | |
| 528 return NULL; | |
| 529 CreateMediaStreamImpl(); | |
| 530 return media_stream_impl_->CreatePeerConnectionHandler(client); | |
| 531 } | |
| 532 | |
| 519 void RenderViewImpl::AddObserver(RenderViewObserver* observer) { | 533 void RenderViewImpl::AddObserver(RenderViewObserver* observer) { |
| 520 observers_.AddObserver(observer); | 534 observers_.AddObserver(observer); |
| 521 } | 535 } |
| 522 | 536 |
| 523 void RenderViewImpl::RemoveObserver(RenderViewObserver* observer) { | 537 void RenderViewImpl::RemoveObserver(RenderViewObserver* observer) { |
| 524 observer->RenderViewGone(); | 538 observer->RenderViewGone(); |
| 525 observers_.RemoveObserver(observer); | 539 observers_.RemoveObserver(observer); |
| 526 } | 540 } |
| 527 | 541 |
| 528 WebKit::WebView* RenderViewImpl::webview() const { | 542 WebKit::WebView* RenderViewImpl::webview() const { |
| (...skipping 2344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2873 size.set_height(static_cast<int>(size.height() * zoom_factor)); | 2887 size.set_height(static_cast<int>(size.height() * zoom_factor)); |
| 2874 | 2888 |
| 2875 if (size == preferred_size_) | 2889 if (size == preferred_size_) |
| 2876 return; | 2890 return; |
| 2877 | 2891 |
| 2878 preferred_size_ = size; | 2892 preferred_size_ = size; |
| 2879 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, | 2893 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, |
| 2880 preferred_size_)); | 2894 preferred_size_)); |
| 2881 } | 2895 } |
| 2882 | 2896 |
| 2897 void RenderViewImpl::CreateMediaStreamImpl() { | |
|
darin (slow to review)
2011/11/23 22:26:36
In chromium, we often use the verb "Ensure" instea
Henrik Grunell
2011/11/24 11:32:59
Done.
| |
| 2898 #if defined(ENABLE_P2P_APIS) | |
| 2899 if (!p2p_socket_dispatcher_) | |
| 2900 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); | |
| 2901 #endif | |
| 2902 | |
| 2903 if (!media_stream_dispatcher_) | |
| 2904 media_stream_dispatcher_ = new MediaStreamDispatcher(this); | |
| 2905 | |
| 2906 if (!media_stream_impl_.get()) { | |
| 2907 MediaStreamDependencyFactory* factory = new MediaStreamDependencyFactory(); | |
| 2908 media_stream_impl_ = new MediaStreamImpl( | |
| 2909 media_stream_dispatcher_, | |
| 2910 p2p_socket_dispatcher_, | |
| 2911 RenderThreadImpl::current()->video_capture_impl_manager(), | |
| 2912 factory); | |
| 2913 } | |
| 2914 } | |
| 2915 | |
| 2883 void RenderViewImpl::didChangeContentsSize(WebFrame* frame, | 2916 void RenderViewImpl::didChangeContentsSize(WebFrame* frame, |
| 2884 const WebSize& size) { | 2917 const WebSize& size) { |
| 2885 if (webview()->mainFrame() != frame) | 2918 if (webview()->mainFrame() != frame) |
| 2886 return; | 2919 return; |
| 2887 WebView* frameView = frame->view(); | 2920 WebView* frameView = frame->view(); |
| 2888 if (!frameView) | 2921 if (!frameView) |
| 2889 return; | 2922 return; |
| 2890 | 2923 |
| 2891 bool has_horizontal_scrollbar = frame->hasHorizontalScrollbar(); | 2924 bool has_horizontal_scrollbar = frame->hasHorizontalScrollbar(); |
| 2892 bool has_vertical_scrollbar = frame->hasVerticalScrollbar(); | 2925 bool has_vertical_scrollbar = frame->hasVerticalScrollbar(); |
| (...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4601 const WebKit::WebString& data, | 4634 const WebKit::WebString& data, |
| 4602 int intent_id) { | 4635 int intent_id) { |
| 4603 webkit_glue::WebIntentData intent_data; | 4636 webkit_glue::WebIntentData intent_data; |
| 4604 intent_data.action = action; | 4637 intent_data.action = action; |
| 4605 intent_data.type = type; | 4638 intent_data.type = type; |
| 4606 intent_data.data = data; | 4639 intent_data.data = data; |
| 4607 Send(new IntentsHostMsg_WebIntentDispatch( | 4640 Send(new IntentsHostMsg_WebIntentDispatch( |
| 4608 routing_id_, intent_data, intent_id)); | 4641 routing_id_, intent_data, intent_id)); |
| 4609 } | 4642 } |
| 4610 | 4643 |
| 4644 WebKit::WebUserMediaClient* RenderViewImpl::userMediaClient() { | |
| 4645 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | |
| 4646 if (!cmd_line->HasSwitch(switches::kEnableMediaStream)) | |
| 4647 return NULL; | |
| 4648 CreateMediaStreamImpl(); | |
| 4649 return media_stream_impl_; | |
| 4650 } | |
| 4651 | |
| 4611 bool RenderViewImpl::IsNonLocalTopLevelNavigation( | 4652 bool RenderViewImpl::IsNonLocalTopLevelNavigation( |
| 4612 const GURL& url, WebKit::WebFrame* frame, WebKit::WebNavigationType type) { | 4653 const GURL& url, WebKit::WebFrame* frame, WebKit::WebNavigationType type) { |
| 4613 // Must be a top level frame. | 4654 // Must be a top level frame. |
| 4614 if (frame->parent() != NULL) | 4655 if (frame->parent() != NULL) |
| 4615 return false; | 4656 return false; |
| 4616 | 4657 |
| 4617 // Navigations initiated within Webkit are not sent out to the external host | 4658 // Navigations initiated within Webkit are not sent out to the external host |
| 4618 // in the following cases. | 4659 // in the following cases. |
| 4619 // 1. The url scheme is not http/https | 4660 // 1. The url scheme is not http/https |
| 4620 // 2. The origin of the url and the opener is the same in which case the | 4661 // 2. The origin of the url and the opener is the same in which case the |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4729 return !!RenderThreadImpl::current()->compositor_thread(); | 4770 return !!RenderThreadImpl::current()->compositor_thread(); |
| 4730 } | 4771 } |
| 4731 | 4772 |
| 4732 void RenderViewImpl::OnJavaBridgeInit( | 4773 void RenderViewImpl::OnJavaBridgeInit( |
| 4733 const IPC::ChannelHandle& channel_handle) { | 4774 const IPC::ChannelHandle& channel_handle) { |
| 4734 DCHECK(!java_bridge_dispatcher_.get()); | 4775 DCHECK(!java_bridge_dispatcher_.get()); |
| 4735 #if defined(ENABLE_JAVA_BRIDGE) | 4776 #if defined(ENABLE_JAVA_BRIDGE) |
| 4736 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); | 4777 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); |
| 4737 #endif | 4778 #endif |
| 4738 } | 4779 } |
| OLD | NEW |