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.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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 #include "content/renderer/devtools_agent.h" | 45 #include "content/renderer/devtools_agent.h" |
| 46 #include "content/renderer/device_orientation_dispatcher.h" | 46 #include "content/renderer/device_orientation_dispatcher.h" |
| 47 #include "content/renderer/mhtml_generator.h" | 47 #include "content/renderer/mhtml_generator.h" |
| 48 #include "content/renderer/external_popup_menu.h" | 48 #include "content/renderer/external_popup_menu.h" |
| 49 #include "content/renderer/geolocation_dispatcher.h" | 49 #include "content/renderer/geolocation_dispatcher.h" |
| 50 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 50 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
| 51 #include "content/renderer/intents_dispatcher.h" | 51 #include "content/renderer/intents_dispatcher.h" |
| 52 #include "content/renderer/load_progress_tracker.h" | 52 #include "content/renderer/load_progress_tracker.h" |
| 53 #include "content/renderer/media/audio_message_filter.h" | 53 #include "content/renderer/media/audio_message_filter.h" |
| 54 #include "content/renderer/media/audio_renderer_impl.h" | 54 #include "content/renderer/media/audio_renderer_impl.h" |
| 55 #include "content/renderer/media/media_stream_dispatcher.h" | |
| 55 #include "content/renderer/media/media_stream_impl.h" | 56 #include "content/renderer/media/media_stream_impl.h" |
| 56 #include "content/renderer/media/render_media_log.h" | 57 #include "content/renderer/media/render_media_log.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" |
| 64 #include "content/renderer/render_view_visitor.h" | 65 #include "content/renderer/render_view_visitor.h" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 379 cached_is_main_frame_pinned_to_left_(false), | 380 cached_is_main_frame_pinned_to_left_(false), |
| 380 cached_is_main_frame_pinned_to_right_(false), | 381 cached_is_main_frame_pinned_to_right_(false), |
| 381 cached_has_main_frame_horizontal_scrollbar_(false), | 382 cached_has_main_frame_horizontal_scrollbar_(false), |
| 382 cached_has_main_frame_vertical_scrollbar_(false), | 383 cached_has_main_frame_vertical_scrollbar_(false), |
| 383 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)), | 384 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)), |
| 384 ALLOW_THIS_IN_INITIALIZER_LIST(accessibility_method_factory_(this)), | 385 ALLOW_THIS_IN_INITIALIZER_LIST(accessibility_method_factory_(this)), |
| 385 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), | 386 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), |
| 386 geolocation_dispatcher_(NULL), | 387 geolocation_dispatcher_(NULL), |
| 387 speech_input_dispatcher_(NULL), | 388 speech_input_dispatcher_(NULL), |
| 388 device_orientation_dispatcher_(NULL), | 389 device_orientation_dispatcher_(NULL), |
| 390 media_stream_dispatcher_(NULL), | |
| 389 accessibility_ack_pending_(false), | 391 accessibility_ack_pending_(false), |
| 390 accessibility_logging_(false), | 392 accessibility_logging_(false), |
| 391 p2p_socket_dispatcher_(NULL), | 393 p2p_socket_dispatcher_(NULL), |
| 392 devtools_agent_(NULL), | 394 devtools_agent_(NULL), |
| 393 session_storage_namespace_id_(session_storage_namespace_id), | 395 session_storage_namespace_id_(session_storage_namespace_id), |
| 394 handling_select_range_(false) { | 396 handling_select_range_(false) { |
| 395 routing_id_ = routing_id; | 397 routing_id_ = routing_id; |
| 396 if (opener_id != MSG_ROUTING_NONE) | 398 if (opener_id != MSG_ROUTING_NONE) |
| 397 opener_id_ = opener_id; | 399 opener_id_ = opener_id; |
| 398 | 400 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 445 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); | 447 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); |
| 446 #endif | 448 #endif |
| 447 | 449 |
| 448 new MHTMLGenerator(this); | 450 new MHTMLGenerator(this); |
| 449 #if defined(OS_MACOSX) | 451 #if defined(OS_MACOSX) |
| 450 new TextInputClientObserver(this); | 452 new TextInputClientObserver(this); |
| 451 #endif // defined(OS_MACOSX) | 453 #endif // defined(OS_MACOSX) |
| 452 | 454 |
| 453 devtools_agent_ = new DevToolsAgent(this); | 455 devtools_agent_ = new DevToolsAgent(this); |
| 454 | 456 |
| 455 if (command_line.HasSwitch(switches::kEnableMediaStream)) { | |
| 456 media_stream_impl_ = new MediaStreamImpl( | |
| 457 RenderThread::current()->video_capture_impl_manager()); | |
| 458 } | |
| 459 | |
| 460 content::GetContentClient()->renderer()->RenderViewCreated(this); | 457 content::GetContentClient()->renderer()->RenderViewCreated(this); |
| 461 } | 458 } |
| 462 | 459 |
| 463 RenderView::~RenderView() { | 460 RenderView::~RenderView() { |
| 464 history_page_ids_.clear(); | 461 history_page_ids_.clear(); |
| 465 | 462 |
| 466 if (decrement_shared_popup_at_destruction_) | 463 if (decrement_shared_popup_at_destruction_) |
| 467 shared_popup_counter_->data--; | 464 shared_popup_counter_->data--; |
| 468 | 465 |
| 469 // If file chooser is still waiting for answer, dispatch empty answer. | 466 // If file chooser is still waiting for answer, dispatch empty answer. |
| (...skipping 3977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4447 speech_input_dispatcher_ = new SpeechInputDispatcher(this, listener); | 4444 speech_input_dispatcher_ = new SpeechInputDispatcher(this, listener); |
| 4448 return speech_input_dispatcher_; | 4445 return speech_input_dispatcher_; |
| 4449 } | 4446 } |
| 4450 | 4447 |
| 4451 WebKit::WebDeviceOrientationClient* RenderView::deviceOrientationClient() { | 4448 WebKit::WebDeviceOrientationClient* RenderView::deviceOrientationClient() { |
| 4452 if (!device_orientation_dispatcher_) | 4449 if (!device_orientation_dispatcher_) |
| 4453 device_orientation_dispatcher_ = new DeviceOrientationDispatcher(this); | 4450 device_orientation_dispatcher_ = new DeviceOrientationDispatcher(this); |
| 4454 return device_orientation_dispatcher_; | 4451 return device_orientation_dispatcher_; |
| 4455 } | 4452 } |
| 4456 | 4453 |
| 4454 WebKit::WebMediaStreamClient* RenderView::mediaStreamClient() { | |
| 4455 #if defined(ENABLE_P2P_APIS) | |
| 4456 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); | |
| 4457 #endif | |
| 4458 | |
| 4459 if (!media_stream_dispatcher_) | |
| 4460 media_stream_dispatcher_ = new MediaStreamDispatcher(this); | |
| 4461 | |
| 4462 if (!media_stream_impl_.get()) | |
|
tommi (sloooow) - chröme
2011/09/23 13:02:42
braces. basically the only time chromium doesn't
grunell (dont use)
2011/09/29 13:38:17
Done.
| |
| 4463 media_stream_impl_ = new MediaStreamImpl( | |
| 4464 media_stream_dispatcher_, | |
| 4465 p2p_socket_dispatcher_, | |
| 4466 RenderThread::current()->video_capture_impl_manager()); | |
| 4467 return media_stream_impl_.get(); | |
| 4468 } | |
| 4469 | |
| 4457 void RenderView::zoomLimitsChanged(double minimum_level, double maximum_level) { | 4470 void RenderView::zoomLimitsChanged(double minimum_level, double maximum_level) { |
| 4458 // For now, don't remember plugin zoom values. We don't want to mix them with | 4471 // For now, don't remember plugin zoom values. We don't want to mix them with |
| 4459 // normal web content (i.e. a fixed layout plugin would usually want them | 4472 // normal web content (i.e. a fixed layout plugin would usually want them |
| 4460 // different). | 4473 // different). |
| 4461 bool remember = !webview()->mainFrame()->document().isPluginDocument(); | 4474 bool remember = !webview()->mainFrame()->document().isPluginDocument(); |
| 4462 | 4475 |
| 4463 int minimum_percent = static_cast<int>( | 4476 int minimum_percent = static_cast<int>( |
| 4464 WebView::zoomLevelToZoomFactor(minimum_level) * 100); | 4477 WebView::zoomLevelToZoomFactor(minimum_level) * 100); |
| 4465 int maximum_percent = static_cast<int>( | 4478 int maximum_percent = static_cast<int>( |
| 4466 WebView::zoomLevelToZoomFactor(maximum_level) * 100); | 4479 WebView::zoomLevelToZoomFactor(maximum_level) * 100); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4644 } | 4657 } |
| 4645 | 4658 |
| 4646 void RenderView::OnLockMouseACK(bool succeeded) { | 4659 void RenderView::OnLockMouseACK(bool succeeded) { |
| 4647 pepper_delegate_.OnLockMouseACK(succeeded); | 4660 pepper_delegate_.OnLockMouseACK(succeeded); |
| 4648 } | 4661 } |
| 4649 | 4662 |
| 4650 void RenderView::OnMouseLockLost() { | 4663 void RenderView::OnMouseLockLost() { |
| 4651 pepper_delegate_.OnMouseLockLost(); | 4664 pepper_delegate_.OnMouseLockLost(); |
| 4652 } | 4665 } |
| 4653 | 4666 |
| OLD | NEW |