| 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 main_render_frame_->SetWebFrame(webview()->mainFrame()); | 955 main_render_frame_->SetWebFrame(webview()->mainFrame()); |
| 956 | 956 |
| 957 if (switches::IsTouchDragDropEnabled()) | 957 if (switches::IsTouchDragDropEnabled()) |
| 958 webview()->settings()->setTouchDragDropEnabled(true); | 958 webview()->settings()->setTouchDragDropEnabled(true); |
| 959 | 959 |
| 960 if (switches::IsTouchEditingEnabled()) | 960 if (switches::IsTouchEditingEnabled()) |
| 961 webview()->settings()->setTouchEditingEnabled(true); | 961 webview()->settings()->setTouchEditingEnabled(true); |
| 962 | 962 |
| (...skipping 2109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3072 // opener after hearing about it from the browser, and the browser does not | 3072 // opener after hearing about it from the browser, and the browser does not |
| 3073 // (yet) care about subframe openers. | 3073 // (yet) care about subframe openers. |
| 3074 if (is_swapped_out_ || frame->parent()) | 3074 if (is_swapped_out_ || frame->parent()) |
| 3075 return; | 3075 return; |
| 3076 | 3076 |
| 3077 // Notify WebContents and all its swapped out RenderViews. | 3077 // Notify WebContents and all its swapped out RenderViews. |
| 3078 Send(new ViewHostMsg_DidDisownOpener(routing_id_)); | 3078 Send(new ViewHostMsg_DidDisownOpener(routing_id_)); |
| 3079 } | 3079 } |
| 3080 | 3080 |
| 3081 void RenderViewImpl::frameDetached(WebFrame* frame) { | 3081 void RenderViewImpl::frameDetached(WebFrame* frame) { |
| 3082 // NOTE: We may get here for either the main frame or for subframes. The |
| 3083 // RenderFrameImpl will be deleted immediately after this call for subframes |
| 3084 // but not for the main frame, which is owned by |main_render_frame_|. |
| 3085 |
| 3082 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameDetached(frame)); | 3086 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameDetached(frame)); |
| 3083 } | 3087 } |
| 3084 | 3088 |
| 3085 void RenderViewImpl::willClose(WebFrame* frame) { | 3089 void RenderViewImpl::willClose(WebFrame* frame) { |
| 3086 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame)); | 3090 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame)); |
| 3087 } | 3091 } |
| 3088 | 3092 |
| 3089 void RenderViewImpl::didMatchCSS( | 3093 void RenderViewImpl::didMatchCSS( |
| 3090 WebFrame* frame, | 3094 WebFrame* frame, |
| 3091 const WebVector<WebString>& newly_matching_selectors, | 3095 const WebVector<WebString>& newly_matching_selectors, |
| (...skipping 3374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6466 for (size_t i = 0; i < icon_urls.size(); i++) { | 6470 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 6467 WebURL url = icon_urls[i].iconURL(); | 6471 WebURL url = icon_urls[i].iconURL(); |
| 6468 if (!url.isEmpty()) | 6472 if (!url.isEmpty()) |
| 6469 urls.push_back(FaviconURL(url, | 6473 urls.push_back(FaviconURL(url, |
| 6470 ToFaviconType(icon_urls[i].iconType()))); | 6474 ToFaviconType(icon_urls[i].iconType()))); |
| 6471 } | 6475 } |
| 6472 SendUpdateFaviconURL(urls); | 6476 SendUpdateFaviconURL(urls); |
| 6473 } | 6477 } |
| 6474 | 6478 |
| 6475 } // namespace content | 6479 } // namespace content |
| OLD | NEW |