| 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 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 #include "content/renderer/render_process.h" | 103 #include "content/renderer/render_process.h" |
| 104 #include "content/renderer/render_thread_impl.h" | 104 #include "content/renderer/render_thread_impl.h" |
| 105 #include "content/renderer/render_view_impl_params.h" | 105 #include "content/renderer/render_view_impl_params.h" |
| 106 #include "content/renderer/render_view_mouse_lock_dispatcher.h" | 106 #include "content/renderer/render_view_mouse_lock_dispatcher.h" |
| 107 #include "content/renderer/render_widget_fullscreen_pepper.h" | 107 #include "content/renderer/render_widget_fullscreen_pepper.h" |
| 108 #include "content/renderer/renderer_date_time_picker.h" | 108 #include "content/renderer/renderer_date_time_picker.h" |
| 109 #include "content/renderer/renderer_webapplicationcachehost_impl.h" | 109 #include "content/renderer/renderer_webapplicationcachehost_impl.h" |
| 110 #include "content/renderer/renderer_webcolorchooser_impl.h" | 110 #include "content/renderer/renderer_webcolorchooser_impl.h" |
| 111 #include "content/renderer/savable_resources.h" | 111 #include "content/renderer/savable_resources.h" |
| 112 #include "content/renderer/speech_recognition_dispatcher.h" | 112 #include "content/renderer/speech_recognition_dispatcher.h" |
| 113 #include "content/renderer/stats_collection_controller.h" | |
| 114 #include "content/renderer/stats_collection_observer.h" | |
| 115 #include "content/renderer/text_input_client_observer.h" | 113 #include "content/renderer/text_input_client_observer.h" |
| 116 #include "content/renderer/v8_value_converter_impl.h" | 114 #include "content/renderer/v8_value_converter_impl.h" |
| 117 #include "content/renderer/web_ui_extension.h" | 115 #include "content/renderer/web_ui_extension.h" |
| 118 #include "content/renderer/web_ui_extension_data.h" | 116 #include "content/renderer/web_ui_extension_data.h" |
| 119 #include "content/renderer/webplugin_delegate_proxy.h" | 117 #include "content/renderer/webplugin_delegate_proxy.h" |
| 120 #include "content/renderer/websharedworker_proxy.h" | 118 #include "content/renderer/websharedworker_proxy.h" |
| 121 #include "media/audio/audio_output_device.h" | 119 #include "media/audio/audio_output_device.h" |
| 122 #include "media/base/audio_renderer_mixer_input.h" | 120 #include "media/base/audio_renderer_mixer_input.h" |
| 123 #include "media/base/filter_collection.h" | 121 #include "media/base/filter_collection.h" |
| 124 #include "media/base/media_switches.h" | 122 #include "media/base/media_switches.h" |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 notification_provider_ = new NotificationProvider(this); | 706 notification_provider_ = new NotificationProvider(this); |
| 709 #else | 707 #else |
| 710 notification_provider_ = NULL; | 708 notification_provider_ = NULL; |
| 711 #endif | 709 #endif |
| 712 | 710 |
| 713 webwidget_ = WebView::create(this); | 711 webwidget_ = WebView::create(this); |
| 714 webwidget_mouse_lock_target_.reset(new WebWidgetLockTarget(webwidget_)); | 712 webwidget_mouse_lock_target_.reset(new WebWidgetLockTarget(webwidget_)); |
| 715 | 713 |
| 716 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 714 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 717 | 715 |
| 718 if (command_line.HasSwitch(switches::kStatsCollectionController)) | |
| 719 stats_collection_observer_.reset(new StatsCollectionObserver(this)); | |
| 720 | |
| 721 #if defined(OS_ANDROID) | 716 #if defined(OS_ANDROID) |
| 722 content::DeviceTelephonyInfo device_info; | 717 content::DeviceTelephonyInfo device_info; |
| 723 | 718 |
| 724 const std::string region_code = | 719 const std::string region_code = |
| 725 command_line.HasSwitch(switches::kNetworkCountryIso) | 720 command_line.HasSwitch(switches::kNetworkCountryIso) |
| 726 ? command_line.GetSwitchValueASCII(switches::kNetworkCountryIso) | 721 ? command_line.GetSwitchValueASCII(switches::kNetworkCountryIso) |
| 727 : device_info.GetNetworkCountryIso(); | 722 : device_info.GetNetworkCountryIso(); |
| 728 content_detectors_.push_back(linked_ptr<ContentDetector>( | 723 content_detectors_.push_back(linked_ptr<ContentDetector>( |
| 729 new AddressDetector())); | 724 new AddressDetector())); |
| 730 content_detectors_.push_back(linked_ptr<ContentDetector>( | 725 content_detectors_.push_back(linked_ptr<ContentDetector>( |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 | 795 |
| 801 new ImageLoadingHelper(this); | 796 new ImageLoadingHelper(this); |
| 802 | 797 |
| 803 // Create renderer_accessibility_ if needed. | 798 // Create renderer_accessibility_ if needed. |
| 804 OnSetAccessibilityMode(params->accessibility_mode); | 799 OnSetAccessibilityMode(params->accessibility_mode); |
| 805 | 800 |
| 806 new IdleUserDetector(this); | 801 new IdleUserDetector(this); |
| 807 | 802 |
| 808 if (command_line.HasSwitch(switches::kDomAutomationController)) | 803 if (command_line.HasSwitch(switches::kDomAutomationController)) |
| 809 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; | 804 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; |
| 810 if (command_line.HasSwitch(switches::kStatsCollectionController)) | |
| 811 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; | |
| 812 | 805 |
| 813 ProcessViewLayoutFlags(command_line); | 806 ProcessViewLayoutFlags(command_line); |
| 814 | 807 |
| 815 GetContentClient()->renderer()->RenderViewCreated(this); | 808 GetContentClient()->renderer()->RenderViewCreated(this); |
| 816 | 809 |
| 817 // If we have an opener_id but we weren't created by a renderer, then | 810 // If we have an opener_id but we weren't created by a renderer, then |
| 818 // it's the browser asking us to set our opener to another RenderView. | 811 // it's the browser asking us to set our opener to another RenderView. |
| 819 if (params->opener_id != MSG_ROUTING_NONE && !params->is_renderer_created) { | 812 if (params->opener_id != MSG_ROUTING_NONE && !params->is_renderer_created) { |
| 820 RenderViewImpl* opener_view = FromRoutingID(params->opener_id); | 813 RenderViewImpl* opener_view = FromRoutingID(params->opener_id); |
| 821 if (opener_view) | 814 if (opener_view) |
| (...skipping 2833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3655 | 3648 |
| 3656 if (enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION) { | 3649 if (enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION) { |
| 3657 if (!dom_automation_controller_) | 3650 if (!dom_automation_controller_) |
| 3658 dom_automation_controller_.reset(new DomAutomationController()); | 3651 dom_automation_controller_.reset(new DomAutomationController()); |
| 3659 dom_automation_controller_->set_message_sender( | 3652 dom_automation_controller_->set_message_sender( |
| 3660 static_cast<RenderView*>(this)); | 3653 static_cast<RenderView*>(this)); |
| 3661 dom_automation_controller_->set_routing_id(routing_id()); | 3654 dom_automation_controller_->set_routing_id(routing_id()); |
| 3662 dom_automation_controller_->BindToJavascript(frame, | 3655 dom_automation_controller_->BindToJavascript(frame, |
| 3663 "domAutomationController"); | 3656 "domAutomationController"); |
| 3664 } | 3657 } |
| 3665 | |
| 3666 if (enabled_bindings_ & BINDINGS_POLICY_STATS_COLLECTION) { | |
| 3667 if (!stats_collection_controller_.get()) | |
| 3668 stats_collection_controller_.reset(new StatsCollectionController()); | |
| 3669 stats_collection_controller_->set_message_sender( | |
| 3670 static_cast<RenderView*>(this)); | |
| 3671 stats_collection_controller_->BindToJavascript(frame, | |
| 3672 "statsCollectionController"); | |
| 3673 } | |
| 3674 } | 3658 } |
| 3675 | 3659 |
| 3676 void RenderViewImpl::didCreateDocumentElement(WebFrame* frame) { | 3660 void RenderViewImpl::didCreateDocumentElement(WebFrame* frame) { |
| 3677 // Notify the browser about non-blank documents loading in the top frame. | 3661 // Notify the browser about non-blank documents loading in the top frame. |
| 3678 GURL url = frame->document().url(); | 3662 GURL url = frame->document().url(); |
| 3679 if (url.is_valid() && url.spec() != kAboutBlankURL) { | 3663 if (url.is_valid() && url.spec() != kAboutBlankURL) { |
| 3680 if (frame == webview()->mainFrame()) | 3664 if (frame == webview()->mainFrame()) |
| 3681 Send(new ViewHostMsg_DocumentAvailableInMainFrame(routing_id_)); | 3665 Send(new ViewHostMsg_DocumentAvailableInMainFrame(routing_id_)); |
| 3682 } | 3666 } |
| 3683 | 3667 |
| (...skipping 2893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6577 WebURL url = icon_urls[i].iconURL(); | 6561 WebURL url = icon_urls[i].iconURL(); |
| 6578 if (!url.isEmpty()) | 6562 if (!url.isEmpty()) |
| 6579 urls.push_back(FaviconURL(url, | 6563 urls.push_back(FaviconURL(url, |
| 6580 ToFaviconType(icon_urls[i].iconType()))); | 6564 ToFaviconType(icon_urls[i].iconType()))); |
| 6581 } | 6565 } |
| 6582 SendUpdateFaviconURL(urls); | 6566 SendUpdateFaviconURL(urls); |
| 6583 } | 6567 } |
| 6584 | 6568 |
| 6585 | 6569 |
| 6586 } // namespace content | 6570 } // namespace content |
| OLD | NEW |