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.h" | 5 #include "content/renderer/render_view.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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 #include "content/renderer/content_renderer_client.h" | 44 #include "content/renderer/content_renderer_client.h" |
45 #include "content/renderer/device_orientation_dispatcher.h" | 45 #include "content/renderer/device_orientation_dispatcher.h" |
46 #include "content/renderer/devtools_agent.h" | 46 #include "content/renderer/devtools_agent.h" |
47 #include "content/renderer/external_popup_menu.h" | 47 #include "content/renderer/external_popup_menu.h" |
48 #include "content/renderer/geolocation_dispatcher.h" | 48 #include "content/renderer/geolocation_dispatcher.h" |
49 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 49 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
50 #include "content/renderer/intents_dispatcher.h" | 50 #include "content/renderer/intents_dispatcher.h" |
51 #include "content/renderer/load_progress_tracker.h" | 51 #include "content/renderer/load_progress_tracker.h" |
52 #include "content/renderer/media/audio_message_filter.h" | 52 #include "content/renderer/media/audio_message_filter.h" |
53 #include "content/renderer/media/audio_renderer_impl.h" | 53 #include "content/renderer/media/audio_renderer_impl.h" |
54 #include "content/renderer/media/media_stream_dispatcher.h" | |
54 #include "content/renderer/media/media_stream_impl.h" | 55 #include "content/renderer/media/media_stream_impl.h" |
55 #include "content/renderer/media/render_media_log.h" | 56 #include "content/renderer/media/render_media_log.h" |
56 #include "content/renderer/mhtml_generator.h" | 57 #include "content/renderer/mhtml_generator.h" |
57 #include "content/renderer/navigation_state.h" | 58 #include "content/renderer/navigation_state.h" |
58 #include "content/renderer/notification_provider.h" | 59 #include "content/renderer/notification_provider.h" |
59 #include "content/renderer/p2p/socket_dispatcher.h" | 60 #include "content/renderer/p2p/socket_dispatcher.h" |
60 #include "content/renderer/plugin_channel_host.h" | 61 #include "content/renderer/plugin_channel_host.h" |
61 #include "content/renderer/render_process.h" | 62 #include "content/renderer/render_process.h" |
62 #include "content/renderer/render_thread.h" | 63 #include "content/renderer/render_thread.h" |
63 #include "content/renderer/render_view_observer.h" | 64 #include "content/renderer/render_view_observer.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
320 target_url_status_(TARGET_NONE), | 321 target_url_status_(TARGET_NONE), |
321 cached_is_main_frame_pinned_to_left_(false), | 322 cached_is_main_frame_pinned_to_left_(false), |
322 cached_is_main_frame_pinned_to_right_(false), | 323 cached_is_main_frame_pinned_to_right_(false), |
323 cached_has_main_frame_horizontal_scrollbar_(false), | 324 cached_has_main_frame_horizontal_scrollbar_(false), |
324 cached_has_main_frame_vertical_scrollbar_(false), | 325 cached_has_main_frame_vertical_scrollbar_(false), |
325 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)), | 326 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)), |
326 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), | 327 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), |
327 geolocation_dispatcher_(NULL), | 328 geolocation_dispatcher_(NULL), |
328 speech_input_dispatcher_(NULL), | 329 speech_input_dispatcher_(NULL), |
329 device_orientation_dispatcher_(NULL), | 330 device_orientation_dispatcher_(NULL), |
331 media_stream_dispatcher_(NULL), | |
330 p2p_socket_dispatcher_(NULL), | 332 p2p_socket_dispatcher_(NULL), |
331 devtools_agent_(NULL), | 333 devtools_agent_(NULL), |
332 renderer_accessibility_(NULL), | 334 renderer_accessibility_(NULL), |
333 session_storage_namespace_id_(session_storage_namespace_id), | 335 session_storage_namespace_id_(session_storage_namespace_id), |
334 handling_select_range_(false) { | 336 handling_select_range_(false) { |
335 routing_id_ = routing_id; | 337 routing_id_ = routing_id; |
336 if (opener_id != MSG_ROUTING_NONE) | 338 if (opener_id != MSG_ROUTING_NONE) |
337 opener_id_ = opener_id; | 339 opener_id_ = opener_id; |
338 | 340 |
339 webwidget_ = WebView::create(this); | 341 webwidget_ = WebView::create(this); |
(...skipping 3860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4200 speech_input_dispatcher_ = new SpeechInputDispatcher(this, listener); | 4202 speech_input_dispatcher_ = new SpeechInputDispatcher(this, listener); |
4201 return speech_input_dispatcher_; | 4203 return speech_input_dispatcher_; |
4202 } | 4204 } |
4203 | 4205 |
4204 WebKit::WebDeviceOrientationClient* RenderView::deviceOrientationClient() { | 4206 WebKit::WebDeviceOrientationClient* RenderView::deviceOrientationClient() { |
4205 if (!device_orientation_dispatcher_) | 4207 if (!device_orientation_dispatcher_) |
4206 device_orientation_dispatcher_ = new DeviceOrientationDispatcher(this); | 4208 device_orientation_dispatcher_ = new DeviceOrientationDispatcher(this); |
4207 return device_orientation_dispatcher_; | 4209 return device_orientation_dispatcher_; |
4208 } | 4210 } |
4209 | 4211 |
4212 WebKit::WebMediaStreamClient* RenderView::mediaStreamClient() { | |
4213 #if defined(ENABLE_P2P_APIS) | |
4214 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); | |
tommi (sloooow) - chröme
2011/10/03 12:14:14
first DCHECK that p2p_socket_dispatcher_ is NULL?
Henrik Grunell
2011/10/18 19:04:05
Added check if already created instead, since it's
| |
4215 #endif | |
4216 | |
4217 if (!media_stream_dispatcher_) | |
4218 media_stream_dispatcher_ = new MediaStreamDispatcher(this); | |
4219 | |
4220 if (!media_stream_impl_.get()) { | |
4221 media_stream_impl_ = new MediaStreamImpl( | |
4222 media_stream_dispatcher_, | |
4223 p2p_socket_dispatcher_, | |
4224 RenderThread::current()->video_capture_impl_manager()); | |
4225 } | |
4226 return media_stream_impl_.get(); | |
4227 } | |
4228 | |
4210 void RenderView::zoomLimitsChanged(double minimum_level, double maximum_level) { | 4229 void RenderView::zoomLimitsChanged(double minimum_level, double maximum_level) { |
4211 // For now, don't remember plugin zoom values. We don't want to mix them with | 4230 // For now, don't remember plugin zoom values. We don't want to mix them with |
4212 // normal web content (i.e. a fixed layout plugin would usually want them | 4231 // normal web content (i.e. a fixed layout plugin would usually want them |
4213 // different). | 4232 // different). |
4214 bool remember = !webview()->mainFrame()->document().isPluginDocument(); | 4233 bool remember = !webview()->mainFrame()->document().isPluginDocument(); |
4215 | 4234 |
4216 int minimum_percent = static_cast<int>( | 4235 int minimum_percent = static_cast<int>( |
4217 WebView::zoomLevelToZoomFactor(minimum_level) * 100); | 4236 WebView::zoomLevelToZoomFactor(minimum_level) * 100); |
4218 int maximum_percent = static_cast<int>( | 4237 int maximum_percent = static_cast<int>( |
4219 WebView::zoomLevelToZoomFactor(maximum_level) * 100); | 4238 WebView::zoomLevelToZoomFactor(maximum_level) * 100); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4397 } | 4416 } |
4398 | 4417 |
4399 void RenderView::OnLockMouseACK(bool succeeded) { | 4418 void RenderView::OnLockMouseACK(bool succeeded) { |
4400 pepper_delegate_.OnLockMouseACK(succeeded); | 4419 pepper_delegate_.OnLockMouseACK(succeeded); |
4401 } | 4420 } |
4402 | 4421 |
4403 void RenderView::OnMouseLockLost() { | 4422 void RenderView::OnMouseLockLost() { |
4404 pepper_delegate_.OnMouseLockLost(); | 4423 pepper_delegate_.OnMouseLockLost(); |
4405 } | 4424 } |
4406 | 4425 |
OLD | NEW |