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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 plugin_find_handler_(NULL), | 696 plugin_find_handler_(NULL), |
697 focused_pepper_plugin_(NULL), | 697 focused_pepper_plugin_(NULL), |
698 pepper_last_mouse_event_target_(NULL), | 698 pepper_last_mouse_event_target_(NULL), |
699 #endif | 699 #endif |
700 enumeration_completion_id_(0), | 700 enumeration_completion_id_(0), |
701 load_progress_tracker_(new LoadProgressTracker(this)), | 701 load_progress_tracker_(new LoadProgressTracker(this)), |
702 session_storage_namespace_id_(params->session_storage_namespace_id), | 702 session_storage_namespace_id_(params->session_storage_namespace_id), |
703 next_snapshot_id_(0) { | 703 next_snapshot_id_(0) { |
704 } | 704 } |
705 | 705 |
706 void RenderViewImpl::Initialize( | 706 void RenderViewImpl::Initialize(RenderViewImplParams* params) { |
707 RenderViewImplParams* params, | |
708 RenderFrameImpl* main_render_frame) { | |
709 routing_id_ = params->routing_id; | 707 routing_id_ = params->routing_id; |
710 surface_id_ = params->surface_id; | 708 surface_id_ = params->surface_id; |
711 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) | 709 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) |
712 opener_id_ = params->opener_id; | 710 opener_id_ = params->opener_id; |
713 | 711 |
714 // Ensure we start with a valid next_page_id_ from the browser. | 712 // Ensure we start with a valid next_page_id_ from the browser. |
715 DCHECK_GE(next_page_id_, 0); | 713 DCHECK_GE(next_page_id_, 0); |
716 | 714 |
| 715 RenderFrameImpl* main_render_frame = RenderFrameImpl::Create( |
| 716 this, params->main_frame_routing_id); |
| 717 // The main frame WebLocalFrame object is closed by |
| 718 // RenderFrameImpl::frameDetached(). |
| 719 WebLocalFrame* web_frame = WebLocalFrame::create(main_render_frame); |
| 720 main_render_frame->SetWebFrame(web_frame); |
| 721 |
717 webwidget_ = WebView::create(this); | 722 webwidget_ = WebView::create(this); |
718 webwidget_mouse_lock_target_.reset(new WebWidgetLockTarget(webwidget_)); | 723 webwidget_mouse_lock_target_.reset(new WebWidgetLockTarget(webwidget_)); |
719 | 724 |
720 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 725 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
721 | 726 |
722 if (command_line.HasSwitch(switches::kStatsCollectionController)) | 727 if (command_line.HasSwitch(switches::kStatsCollectionController)) |
723 stats_collection_observer_.reset(new StatsCollectionObserver(this)); | 728 stats_collection_observer_.reset(new StatsCollectionObserver(this)); |
724 | 729 |
725 #if defined(OS_ANDROID) | 730 #if defined(OS_ANDROID) |
726 content::DeviceTelephonyInfo device_info; | 731 content::DeviceTelephonyInfo device_info; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 never_visible, | 957 never_visible, |
953 next_page_id, | 958 next_page_id, |
954 screen_info, | 959 screen_info, |
955 accessibility_mode); | 960 accessibility_mode); |
956 RenderViewImpl* render_view = NULL; | 961 RenderViewImpl* render_view = NULL; |
957 if (g_create_render_view_impl) | 962 if (g_create_render_view_impl) |
958 render_view = g_create_render_view_impl(¶ms); | 963 render_view = g_create_render_view_impl(¶ms); |
959 else | 964 else |
960 render_view = new RenderViewImpl(¶ms); | 965 render_view = new RenderViewImpl(¶ms); |
961 | 966 |
962 RenderFrameImpl* main_frame = RenderFrameImpl::Create( | 967 render_view->Initialize(¶ms); |
963 render_view, main_frame_routing_id); | |
964 // The main frame WebLocalFrame object is closed by | |
965 // RenderFrameImpl::frameDetached(). | |
966 WebLocalFrame* web_frame = WebLocalFrame::create(main_frame); | |
967 main_frame->SetWebFrame(web_frame); | |
968 | |
969 render_view->Initialize(¶ms, main_frame); | |
970 return render_view; | 968 return render_view; |
971 } | 969 } |
972 | 970 |
973 // static | 971 // static |
974 void RenderViewImpl::InstallCreateHook( | 972 void RenderViewImpl::InstallCreateHook( |
975 RenderViewImpl* (*create_render_view_impl)(RenderViewImplParams*)) { | 973 RenderViewImpl* (*create_render_view_impl)(RenderViewImplParams*)) { |
976 CHECK(!g_create_render_view_impl); | 974 CHECK(!g_create_render_view_impl); |
977 g_create_render_view_impl = create_render_view_impl; | 975 g_create_render_view_impl = create_render_view_impl; |
978 } | 976 } |
979 | 977 |
(...skipping 3459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4439 std::vector<gfx::Size> sizes; | 4437 std::vector<gfx::Size> sizes; |
4440 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4438 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4441 if (!url.isEmpty()) | 4439 if (!url.isEmpty()) |
4442 urls.push_back( | 4440 urls.push_back( |
4443 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4441 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4444 } | 4442 } |
4445 SendUpdateFaviconURL(urls); | 4443 SendUpdateFaviconURL(urls); |
4446 } | 4444 } |
4447 | 4445 |
4448 } // namespace content | 4446 } // namespace content |
OLD | NEW |