| 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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 opener_id_ = params.opener_route_id; | 666 opener_id_ = params.opener_route_id; |
| 667 display_mode_= params.initial_size.display_mode; | 667 display_mode_= params.initial_size.display_mode; |
| 668 | 668 |
| 669 // Ensure we start with a valid next_page_id_ from the browser. | 669 // Ensure we start with a valid next_page_id_ from the browser. |
| 670 DCHECK_GE(next_page_id_, 0); | 670 DCHECK_GE(next_page_id_, 0); |
| 671 | 671 |
| 672 main_render_frame_ = RenderFrameImpl::Create( | 672 main_render_frame_ = RenderFrameImpl::Create( |
| 673 this, params.main_frame_routing_id); | 673 this, params.main_frame_routing_id); |
| 674 // The main frame WebLocalFrame object is closed by | 674 // The main frame WebLocalFrame object is closed by |
| 675 // RenderFrameImpl::frameDetached(). | 675 // RenderFrameImpl::frameDetached(). |
| 676 WebLocalFrame* web_frame = WebLocalFrame::create(main_render_frame_); | 676 WebLocalFrame* web_frame = WebLocalFrame::create( |
| 677 blink::WebTreeScopeType::Document, main_render_frame_); |
| 677 main_render_frame_->SetWebFrame(web_frame); | 678 main_render_frame_->SetWebFrame(web_frame); |
| 678 | 679 |
| 679 compositor_deps_ = compositor_deps; | 680 compositor_deps_ = compositor_deps; |
| 680 webwidget_ = WebView::create(this); | 681 webwidget_ = WebView::create(this); |
| 681 webwidget_mouse_lock_target_.reset(new WebWidgetLockTarget(webwidget_)); | 682 webwidget_mouse_lock_target_.reset(new WebWidgetLockTarget(webwidget_)); |
| 682 | 683 |
| 683 const base::CommandLine& command_line = | 684 const base::CommandLine& command_line = |
| 684 *base::CommandLine::ForCurrentProcess(); | 685 *base::CommandLine::ForCurrentProcess(); |
| 685 | 686 |
| 686 if (command_line.HasSwitch(switches::kStatsCollectionController)) | 687 if (command_line.HasSwitch(switches::kStatsCollectionController)) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 !command_line.HasSwitch(switches::kDisableThreadedScrolling)); | 728 !command_line.HasSwitch(switches::kDisableThreadedScrolling)); |
| 728 webview()->settings()->setRootLayerScrolls( | 729 webview()->settings()->setRootLayerScrolls( |
| 729 command_line.HasSwitch(switches::kRootLayerScrolls)); | 730 command_line.HasSwitch(switches::kRootLayerScrolls)); |
| 730 | 731 |
| 731 ApplyWebPreferences(webkit_preferences_, webview()); | 732 ApplyWebPreferences(webkit_preferences_, webview()); |
| 732 | 733 |
| 733 RenderFrameProxy* proxy = NULL; | 734 RenderFrameProxy* proxy = NULL; |
| 734 if (params.proxy_routing_id != MSG_ROUTING_NONE) { | 735 if (params.proxy_routing_id != MSG_ROUTING_NONE) { |
| 735 CHECK(params.swapped_out); | 736 CHECK(params.swapped_out); |
| 736 proxy = RenderFrameProxy::CreateProxyToReplaceFrame( | 737 proxy = RenderFrameProxy::CreateProxyToReplaceFrame( |
| 737 main_render_frame_, params.proxy_routing_id); | 738 main_render_frame_, params.proxy_routing_id, |
| 739 blink::WebTreeScopeType::Document); |
| 738 main_render_frame_->set_render_frame_proxy(proxy); | 740 main_render_frame_->set_render_frame_proxy(proxy); |
| 739 } | 741 } |
| 740 | 742 |
| 741 // In --site-per-process, just use the WebRemoteFrame as the main frame. | 743 // In --site-per-process, just use the WebRemoteFrame as the main frame. |
| 742 if (command_line.HasSwitch(switches::kSitePerProcess) && proxy) { | 744 if (command_line.HasSwitch(switches::kSitePerProcess) && proxy) { |
| 743 webview()->setMainFrame(proxy->web_frame()); | 745 webview()->setMainFrame(proxy->web_frame()); |
| 744 // Initialize the WebRemoteFrame with information replicated from the | 746 // Initialize the WebRemoteFrame with information replicated from the |
| 745 // browser process. | 747 // browser process. |
| 746 proxy->SetReplicatedState(params.replicated_frame_state); | 748 proxy->SetReplicatedState(params.replicated_frame_state); |
| 747 } else { | 749 } else { |
| (...skipping 3013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3761 std::vector<gfx::Size> sizes; | 3763 std::vector<gfx::Size> sizes; |
| 3762 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3764 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 3763 if (!url.isEmpty()) | 3765 if (!url.isEmpty()) |
| 3764 urls.push_back( | 3766 urls.push_back( |
| 3765 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 3767 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 3766 } | 3768 } |
| 3767 SendUpdateFaviconURL(urls); | 3769 SendUpdateFaviconURL(urls); |
| 3768 } | 3770 } |
| 3769 | 3771 |
| 3770 } // namespace content | 3772 } // namespace content |
| OLD | NEW |