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