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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 webview()->settings()->setAcceleratedCompositingForScrollableFramesEnabled( | 945 webview()->settings()->setAcceleratedCompositingForScrollableFramesEnabled( |
946 ShouldUseAcceleratedCompositingForScrollableFrames(device_scale_factor_)); | 946 ShouldUseAcceleratedCompositingForScrollableFrames(device_scale_factor_)); |
947 webview()->settings()->setCompositedScrollingForFramesEnabled( | 947 webview()->settings()->setCompositedScrollingForFramesEnabled( |
948 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); | 948 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); |
949 | 949 |
950 ApplyWebPreferences(webkit_preferences_, webview()); | 950 ApplyWebPreferences(webkit_preferences_, webview()); |
951 | 951 |
952 main_render_frame_.reset( | 952 main_render_frame_.reset( |
953 RenderFrameImpl::Create(this, params->main_frame_routing_id)); | 953 RenderFrameImpl::Create(this, params->main_frame_routing_id)); |
954 // The main frame WebFrame object is closed by | 954 // The main frame WebFrame object is closed by |
955 // RenderViewImpl::frameDetached(). | 955 // RenderFrameImpl::frameDetached(). |
956 webview()->setMainFrame(WebFrame::create(main_render_frame_.get())); | 956 webview()->setMainFrame(WebFrame::create(main_render_frame_.get())); |
957 main_render_frame_->MainWebFrameCreated(webview()->mainFrame()); | 957 main_render_frame_->MainWebFrameCreated(webview()->mainFrame()); |
958 | 958 |
959 if (switches::IsTouchDragDropEnabled()) | 959 if (switches::IsTouchDragDropEnabled()) |
960 webview()->settings()->setTouchDragDropEnabled(true); | 960 webview()->settings()->setTouchDragDropEnabled(true); |
961 | 961 |
962 if (switches::IsTouchEditingEnabled()) | 962 if (switches::IsTouchEditingEnabled()) |
963 webview()->settings()->setTouchEditingEnabled(true); | 963 webview()->settings()->setTouchEditingEnabled(true); |
964 | 964 |
965 if (!params->frame_name.empty()) | 965 if (!params->frame_name.empty()) |
(...skipping 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3074 // opener after hearing about it from the browser, and the browser does not | 3074 // opener after hearing about it from the browser, and the browser does not |
3075 // (yet) care about subframe openers. | 3075 // (yet) care about subframe openers. |
3076 if (is_swapped_out_ || frame->parent()) | 3076 if (is_swapped_out_ || frame->parent()) |
3077 return; | 3077 return; |
3078 | 3078 |
3079 // Notify WebContents and all its swapped out RenderViews. | 3079 // Notify WebContents and all its swapped out RenderViews. |
3080 Send(new ViewHostMsg_DidDisownOpener(routing_id_)); | 3080 Send(new ViewHostMsg_DidDisownOpener(routing_id_)); |
3081 } | 3081 } |
3082 | 3082 |
3083 void RenderViewImpl::frameDetached(WebFrame* frame) { | 3083 void RenderViewImpl::frameDetached(WebFrame* frame) { |
| 3084 // NOTE: We may get here for either the main frame or for subframes. The |
| 3085 // RenderFrameImpl will be deleted immediately after this call for subframes |
| 3086 // but not for the main frame, which is kept around in a scoped_ptr. |
| 3087 |
3084 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameDetached(frame)); | 3088 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameDetached(frame)); |
3085 } | 3089 } |
3086 | 3090 |
3087 void RenderViewImpl::willClose(WebFrame* frame) { | 3091 void RenderViewImpl::willClose(WebFrame* frame) { |
3088 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame)); | 3092 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame)); |
3089 } | 3093 } |
3090 | 3094 |
3091 void RenderViewImpl::didMatchCSS( | 3095 void RenderViewImpl::didMatchCSS( |
3092 WebFrame* frame, | 3096 WebFrame* frame, |
3093 const WebVector<WebString>& newly_matching_selectors, | 3097 const WebVector<WebString>& newly_matching_selectors, |
(...skipping 3374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6468 for (size_t i = 0; i < icon_urls.size(); i++) { | 6472 for (size_t i = 0; i < icon_urls.size(); i++) { |
6469 WebURL url = icon_urls[i].iconURL(); | 6473 WebURL url = icon_urls[i].iconURL(); |
6470 if (!url.isEmpty()) | 6474 if (!url.isEmpty()) |
6471 urls.push_back(FaviconURL(url, | 6475 urls.push_back(FaviconURL(url, |
6472 ToFaviconType(icon_urls[i].iconType()))); | 6476 ToFaviconType(icon_urls[i].iconType()))); |
6473 } | 6477 } |
6474 SendUpdateFaviconURL(urls); | 6478 SendUpdateFaviconURL(urls); |
6475 } | 6479 } |
6476 | 6480 |
6477 } // namespace content | 6481 } // namespace content |
OLD | NEW |