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 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
864 #if defined(ENABLE_PLUGINS) | 864 #if defined(ENABLE_PLUGINS) |
865 focused_pepper_plugin_(NULL), | 865 focused_pepper_plugin_(NULL), |
866 pepper_last_mouse_event_target_(NULL), | 866 pepper_last_mouse_event_target_(NULL), |
867 #endif | 867 #endif |
868 enumeration_completion_id_(0), | 868 enumeration_completion_id_(0), |
869 load_progress_tracker_(new LoadProgressTracker(this)), | 869 load_progress_tracker_(new LoadProgressTracker(this)), |
870 session_storage_namespace_id_(params->session_storage_namespace_id), | 870 session_storage_namespace_id_(params->session_storage_namespace_id), |
871 handling_select_range_(false), | 871 handling_select_range_(false), |
872 next_snapshot_id_(0), | 872 next_snapshot_id_(0), |
873 allow_partial_swap_(params->allow_partial_swap), | 873 allow_partial_swap_(params->allow_partial_swap), |
874 dom_automation_controller_(NULL), | |
874 context_menu_source_type_(ui::MENU_SOURCE_MOUSE) { | 875 context_menu_source_type_(ui::MENU_SOURCE_MOUSE) { |
875 } | 876 } |
876 | 877 |
877 void RenderViewImpl::Initialize(RenderViewImplParams* params) { | 878 void RenderViewImpl::Initialize(RenderViewImplParams* params) { |
878 routing_id_ = params->routing_id; | 879 routing_id_ = params->routing_id; |
879 surface_id_ = params->surface_id; | 880 surface_id_ = params->surface_id; |
880 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) | 881 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) |
881 opener_id_ = params->opener_id; | 882 opener_id_ = params->opener_id; |
882 | 883 |
883 // Ensure we start with a valid next_page_id_ from the browser. | 884 // Ensure we start with a valid next_page_id_ from the browser. |
(...skipping 2770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3654 if (!frame->parent()) { // Only for top frames. | 3655 if (!frame->parent()) { // Only for top frames. |
3655 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current(); | 3656 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current(); |
3656 if (render_thread_impl) { // Can be NULL in tests. | 3657 if (render_thread_impl) { // Can be NULL in tests. |
3657 render_thread_impl->histogram_customizer()-> | 3658 render_thread_impl->histogram_customizer()-> |
3658 RenderViewNavigatedToHost(GURL(GetLoadingUrl(frame)).host(), | 3659 RenderViewNavigatedToHost(GURL(GetLoadingUrl(frame)).host(), |
3659 g_view_map.Get().size()); | 3660 g_view_map.Get().size()); |
3660 } | 3661 } |
3661 } | 3662 } |
3662 } | 3663 } |
3663 | 3664 |
3664 void RenderViewImpl::didClearWindowObject(WebFrame* frame) { | 3665 void RenderViewImpl::didClearWindowObject(WebFrame* frame) { |
Aaron Boodman
2014/01/09 20:19:20
Does this get called for every frame in the view,
| |
3665 FOR_EACH_OBSERVER(RenderViewObserver, observers_, | 3666 FOR_EACH_OBSERVER(RenderViewObserver, observers_, |
3666 DidClearWindowObject(frame)); | 3667 DidClearWindowObject(frame)); |
3667 | 3668 |
3668 if (enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION) { | 3669 if (enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION) { |
3669 if (!dom_automation_controller_) | 3670 if (!dom_automation_controller_) |
3670 dom_automation_controller_.reset(new DomAutomationController()); | 3671 dom_automation_controller_ = new DomAutomationController(this); |
3671 dom_automation_controller_->set_message_sender( | 3672 dom_automation_controller_->Install(frame); |
3672 static_cast<RenderView*>(this)); | |
3673 dom_automation_controller_->set_routing_id(routing_id()); | |
3674 dom_automation_controller_->BindToJavascript(frame, | |
3675 "domAutomationController"); | |
3676 } | 3673 } |
3677 | 3674 |
3678 if (enabled_bindings_ & BINDINGS_POLICY_STATS_COLLECTION) | 3675 if (enabled_bindings_ & BINDINGS_POLICY_STATS_COLLECTION) |
3679 StatsCollectionController::Install(frame); | 3676 StatsCollectionController::Install(frame); |
3680 } | 3677 } |
3681 | 3678 |
3682 void RenderViewImpl::didCreateDocumentElement(WebFrame* frame) { | 3679 void RenderViewImpl::didCreateDocumentElement(WebFrame* frame) { |
3683 FOR_EACH_OBSERVER(RenderViewObserver, observers_, | 3680 FOR_EACH_OBSERVER(RenderViewObserver, observers_, |
3684 DidCreateDocumentElement(frame)); | 3681 DidCreateDocumentElement(frame)); |
3685 } | 3682 } |
(...skipping 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6380 for (size_t i = 0; i < icon_urls.size(); i++) { | 6377 for (size_t i = 0; i < icon_urls.size(); i++) { |
6381 WebURL url = icon_urls[i].iconURL(); | 6378 WebURL url = icon_urls[i].iconURL(); |
6382 if (!url.isEmpty()) | 6379 if (!url.isEmpty()) |
6383 urls.push_back(FaviconURL(url, | 6380 urls.push_back(FaviconURL(url, |
6384 ToFaviconType(icon_urls[i].iconType()))); | 6381 ToFaviconType(icon_urls[i].iconType()))); |
6385 } | 6382 } |
6386 SendUpdateFaviconURL(urls); | 6383 SendUpdateFaviconURL(urls); |
6387 } | 6384 } |
6388 | 6385 |
6389 } // namespace content | 6386 } // namespace content |
OLD | NEW |