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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
942 webview()->settings()->setAcceleratedCompositingForScrollableFramesEnabled( | 942 webview()->settings()->setAcceleratedCompositingForScrollableFramesEnabled( |
943 ShouldUseAcceleratedCompositingForScrollableFrames(device_scale_factor_)); | 943 ShouldUseAcceleratedCompositingForScrollableFrames(device_scale_factor_)); |
944 webview()->settings()->setCompositedScrollingForFramesEnabled( | 944 webview()->settings()->setCompositedScrollingForFramesEnabled( |
945 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); | 945 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); |
946 | 946 |
947 ApplyWebPreferences(webkit_preferences_, webview()); | 947 ApplyWebPreferences(webkit_preferences_, webview()); |
948 | 948 |
949 main_render_frame_.reset( | 949 main_render_frame_.reset( |
950 RenderFrameImpl::Create(this, params->main_frame_routing_id)); | 950 RenderFrameImpl::Create(this, params->main_frame_routing_id)); |
951 // The main frame WebFrame object is closed by | 951 // The main frame WebFrame object is closed by |
952 // RenderViewImpl::frameDetached(). | 952 // RenderFrameImpl::frameDetached(). |
953 webview()->setMainFrame(WebFrame::create(main_render_frame_.get())); | 953 webview()->setMainFrame(WebFrame::create(main_render_frame_.get())); |
954 main_render_frame_->MainWebFrameCreated(webview()->mainFrame()); | 954 main_render_frame_->MainWebFrameCreated(webview()->mainFrame()); |
955 | 955 |
956 if (switches::IsTouchDragDropEnabled()) | 956 if (switches::IsTouchDragDropEnabled()) |
957 webview()->settings()->setTouchDragDropEnabled(true); | 957 webview()->settings()->setTouchDragDropEnabled(true); |
958 | 958 |
959 if (switches::IsTouchEditingEnabled()) | 959 if (switches::IsTouchEditingEnabled()) |
960 webview()->settings()->setTouchEditingEnabled(true); | 960 webview()->settings()->setTouchEditingEnabled(true); |
961 | 961 |
962 if (!params->frame_name.empty()) | 962 if (!params->frame_name.empty()) |
(...skipping 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3062 // opener after hearing about it from the browser, and the browser does not | 3062 // opener after hearing about it from the browser, and the browser does not |
3063 // (yet) care about subframe openers. | 3063 // (yet) care about subframe openers. |
3064 if (is_swapped_out_ || frame->parent()) | 3064 if (is_swapped_out_ || frame->parent()) |
3065 return; | 3065 return; |
3066 | 3066 |
3067 // Notify WebContents and all its swapped out RenderViews. | 3067 // Notify WebContents and all its swapped out RenderViews. |
3068 Send(new ViewHostMsg_DidDisownOpener(routing_id_)); | 3068 Send(new ViewHostMsg_DidDisownOpener(routing_id_)); |
3069 } | 3069 } |
3070 | 3070 |
3071 void RenderViewImpl::frameDetached(WebFrame* frame) { | 3071 void RenderViewImpl::frameDetached(WebFrame* frame) { |
3072 // NOTE: We may get here for either the main frame or for subframes. The | |
3073 // RenderFrameImpl will be deleted immediately after this call for subframes | |
3074 // but not for the main frame, which is kept around in a scoped_ptr. | |
awong
2013/12/27 21:59:36
nit: kept around in a scoped_ptr -> owned by |main
nasko
2013/12/27 22:14:53
Done.
| |
3075 | |
3072 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameDetached(frame)); | 3076 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameDetached(frame)); |
3073 } | 3077 } |
3074 | 3078 |
3075 void RenderViewImpl::willClose(WebFrame* frame) { | 3079 void RenderViewImpl::willClose(WebFrame* frame) { |
3076 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame)); | 3080 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame)); |
3077 } | 3081 } |
3078 | 3082 |
3079 void RenderViewImpl::didMatchCSS( | 3083 void RenderViewImpl::didMatchCSS( |
3080 WebFrame* frame, | 3084 WebFrame* frame, |
3081 const WebVector<WebString>& newly_matching_selectors, | 3085 const WebVector<WebString>& newly_matching_selectors, |
(...skipping 3372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6454 for (size_t i = 0; i < icon_urls.size(); i++) { | 6458 for (size_t i = 0; i < icon_urls.size(); i++) { |
6455 WebURL url = icon_urls[i].iconURL(); | 6459 WebURL url = icon_urls[i].iconURL(); |
6456 if (!url.isEmpty()) | 6460 if (!url.isEmpty()) |
6457 urls.push_back(FaviconURL(url, | 6461 urls.push_back(FaviconURL(url, |
6458 ToFaviconType(icon_urls[i].iconType()))); | 6462 ToFaviconType(icon_urls[i].iconType()))); |
6459 } | 6463 } |
6460 SendUpdateFaviconURL(urls); | 6464 SendUpdateFaviconURL(urls); |
6461 } | 6465 } |
6462 | 6466 |
6463 } // namespace content | 6467 } // namespace content |
OLD | NEW |