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 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 #endif | 802 #endif |
803 session_storage_namespace_id_(params->session_storage_namespace_id), | 803 session_storage_namespace_id_(params->session_storage_namespace_id), |
804 decrement_shared_popup_at_destruction_(false), | 804 decrement_shared_popup_at_destruction_(false), |
805 handling_select_range_(false), | 805 handling_select_range_(false), |
806 next_snapshot_id_(0), | 806 next_snapshot_id_(0), |
807 allow_partial_swap_(params->allow_partial_swap), | 807 allow_partial_swap_(params->allow_partial_swap), |
808 context_menu_source_type_(content::CONTEXT_MENU_SOURCE_MOUSE) { | 808 context_menu_source_type_(content::CONTEXT_MENU_SOURCE_MOUSE) { |
809 } | 809 } |
810 | 810 |
811 void RenderViewImpl::Initialize(RenderViewImplParams* params) { | 811 void RenderViewImpl::Initialize(RenderViewImplParams* params) { |
812 main_render_frame_.reset(new RenderFrameImpl( | 812 RenderFrameImpl* main_frame = RenderFrameImpl::Create( |
813 this, params->main_frame_routing_id)); | 813 this, params->main_frame_routing_id); |
| 814 main_render_frame_.reset(main_frame); |
814 | 815 |
815 #if defined(ENABLE_PLUGINS) | 816 #if defined(ENABLE_PLUGINS) |
816 pepper_helper_.reset(new PepperPluginDelegateImpl(this)); | 817 pepper_helper_.reset(new PepperPluginDelegateImpl(this)); |
817 #else | 818 #else |
818 pepper_helper_.reset(new RenderViewPepperHelper()); | 819 pepper_helper_.reset(new RenderViewPepperHelper()); |
819 #endif | 820 #endif |
820 routing_id_ = params->routing_id; | 821 routing_id_ = params->routing_id; |
821 surface_id_ = params->surface_id; | 822 surface_id_ = params->surface_id; |
822 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) | 823 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) |
823 opener_id_ = params->opener_id; | 824 opener_id_ = params->opener_id; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 | 880 |
880 g_view_map.Get().insert(std::make_pair(webview(), this)); | 881 g_view_map.Get().insert(std::make_pair(webview(), this)); |
881 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); | 882 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); |
882 webview()->setDeviceScaleFactor(device_scale_factor_); | 883 webview()->setDeviceScaleFactor(device_scale_factor_); |
883 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( | 884 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( |
884 ShouldUseFixedPositionCompositing(device_scale_factor_)); | 885 ShouldUseFixedPositionCompositing(device_scale_factor_)); |
885 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( | 886 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( |
886 ShouldUseTransitionCompositing(device_scale_factor_)); | 887 ShouldUseTransitionCompositing(device_scale_factor_)); |
887 | 888 |
888 webkit_glue::ApplyWebPreferences(webkit_preferences_, webview()); | 889 webkit_glue::ApplyWebPreferences(webkit_preferences_, webview()); |
889 webview()->initializeMainFrame(this); | 890 webview()->initializeMainFrame(main_render_frame_.get()); |
890 | 891 |
891 if (switches::IsTouchDragDropEnabled()) | 892 if (switches::IsTouchDragDropEnabled()) |
892 webview()->settings()->setTouchDragDropEnabled(true); | 893 webview()->settings()->setTouchDragDropEnabled(true); |
893 | 894 |
894 if (switches::IsTouchEditingEnabled()) | 895 if (switches::IsTouchEditingEnabled()) |
895 webview()->settings()->setTouchEditingEnabled(true); | 896 webview()->settings()->setTouchEditingEnabled(true); |
896 | 897 |
897 if (!params->frame_name.empty()) | 898 if (!params->frame_name.empty()) |
898 webview()->mainFrame()->setName(params->frame_name); | 899 webview()->mainFrame()->setName(params->frame_name); |
899 | 900 |
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2246 int id = enumeration_completion_id_++; | 2247 int id = enumeration_completion_id_++; |
2247 enumeration_completions_[id] = chooser_completion; | 2248 enumeration_completions_[id] = chooser_completion; |
2248 return Send(new ViewHostMsg_EnumerateDirectory( | 2249 return Send(new ViewHostMsg_EnumerateDirectory( |
2249 routing_id_, | 2250 routing_id_, |
2250 id, | 2251 id, |
2251 webkit_base::WebStringToFilePath(path))); | 2252 webkit_base::WebStringToFilePath(path))); |
2252 } | 2253 } |
2253 | 2254 |
2254 void RenderViewImpl::initializeHelperPluginWebFrame( | 2255 void RenderViewImpl::initializeHelperPluginWebFrame( |
2255 WebKit::WebHelperPlugin* plugin) { | 2256 WebKit::WebHelperPlugin* plugin) { |
2256 plugin->initializeFrame(this); | 2257 plugin->initializeFrame(main_render_frame_.get()); |
2257 } | 2258 } |
2258 | 2259 |
2259 void RenderViewImpl::didStartLoading() { | 2260 void RenderViewImpl::didStartLoading() { |
2260 if (is_loading_) { | 2261 if (is_loading_) { |
2261 DVLOG(1) << "didStartLoading called while loading"; | 2262 DVLOG(1) << "didStartLoading called while loading"; |
2262 return; | 2263 return; |
2263 } | 2264 } |
2264 | 2265 |
2265 is_loading_ = true; | 2266 is_loading_ = true; |
2266 | 2267 |
(...skipping 4490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6757 WebURL url = icon_urls[i].iconURL(); | 6758 WebURL url = icon_urls[i].iconURL(); |
6758 if (!url.isEmpty()) | 6759 if (!url.isEmpty()) |
6759 urls.push_back(FaviconURL(url, | 6760 urls.push_back(FaviconURL(url, |
6760 ToFaviconType(icon_urls[i].iconType()))); | 6761 ToFaviconType(icon_urls[i].iconType()))); |
6761 } | 6762 } |
6762 SendUpdateFaviconURL(urls); | 6763 SendUpdateFaviconURL(urls); |
6763 } | 6764 } |
6764 | 6765 |
6765 | 6766 |
6766 } // namespace content | 6767 } // namespace content |
OLD | NEW |