| 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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 #endif | 813 #endif |
| 814 session_storage_namespace_id_(params->session_storage_namespace_id), | 814 session_storage_namespace_id_(params->session_storage_namespace_id), |
| 815 decrement_shared_popup_at_destruction_(false), | 815 decrement_shared_popup_at_destruction_(false), |
| 816 handling_select_range_(false), | 816 handling_select_range_(false), |
| 817 next_snapshot_id_(0), | 817 next_snapshot_id_(0), |
| 818 allow_partial_swap_(params->allow_partial_swap), | 818 allow_partial_swap_(params->allow_partial_swap), |
| 819 context_menu_source_type_(ui::MENU_SOURCE_MOUSE) { | 819 context_menu_source_type_(ui::MENU_SOURCE_MOUSE) { |
| 820 } | 820 } |
| 821 | 821 |
| 822 void RenderViewImpl::Initialize(RenderViewImplParams* params) { | 822 void RenderViewImpl::Initialize(RenderViewImplParams* params) { |
| 823 main_render_frame_.reset(new RenderFrameImpl( | 823 RenderFrameImpl* main_frame = RenderFrameImpl::Create( |
| 824 this, params->main_frame_routing_id)); | 824 this, params->main_frame_routing_id); |
| 825 main_render_frame_.reset(main_frame); |
| 825 | 826 |
| 826 #if defined(ENABLE_PLUGINS) | 827 #if defined(ENABLE_PLUGINS) |
| 827 pepper_helper_.reset(new PepperPluginDelegateImpl(this)); | 828 pepper_helper_.reset(new PepperPluginDelegateImpl(this)); |
| 828 #else | 829 #else |
| 829 pepper_helper_.reset(new RenderViewPepperHelper()); | 830 pepper_helper_.reset(new RenderViewPepperHelper()); |
| 830 #endif | 831 #endif |
| 831 routing_id_ = params->routing_id; | 832 routing_id_ = params->routing_id; |
| 832 surface_id_ = params->surface_id; | 833 surface_id_ = params->surface_id; |
| 833 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) | 834 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) |
| 834 opener_id_ = params->opener_id; | 835 opener_id_ = params->opener_id; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); | 893 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); |
| 893 webview()->setDeviceScaleFactor(device_scale_factor_); | 894 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 894 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( | 895 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( |
| 895 ShouldUseFixedPositionCompositing(device_scale_factor_)); | 896 ShouldUseFixedPositionCompositing(device_scale_factor_)); |
| 896 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( | 897 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( |
| 897 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); | 898 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); |
| 898 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( | 899 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( |
| 899 ShouldUseTransitionCompositing(device_scale_factor_)); | 900 ShouldUseTransitionCompositing(device_scale_factor_)); |
| 900 | 901 |
| 901 webkit_glue::ApplyWebPreferences(webkit_preferences_, webview()); | 902 webkit_glue::ApplyWebPreferences(webkit_preferences_, webview()); |
| 902 webview()->initializeMainFrame(this); | 903 webview()->initializeMainFrame(main_render_frame_.get()); |
| 903 | 904 |
| 904 if (switches::IsTouchDragDropEnabled()) | 905 if (switches::IsTouchDragDropEnabled()) |
| 905 webview()->settings()->setTouchDragDropEnabled(true); | 906 webview()->settings()->setTouchDragDropEnabled(true); |
| 906 | 907 |
| 907 if (switches::IsTouchEditingEnabled()) | 908 if (switches::IsTouchEditingEnabled()) |
| 908 webview()->settings()->setTouchEditingEnabled(true); | 909 webview()->settings()->setTouchEditingEnabled(true); |
| 909 | 910 |
| 910 if (!params->frame_name.empty()) | 911 if (!params->frame_name.empty()) |
| 911 webview()->mainFrame()->setName(params->frame_name); | 912 webview()->mainFrame()->setName(params->frame_name); |
| 912 | 913 |
| (...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2257 int id = enumeration_completion_id_++; | 2258 int id = enumeration_completion_id_++; |
| 2258 enumeration_completions_[id] = chooser_completion; | 2259 enumeration_completions_[id] = chooser_completion; |
| 2259 return Send(new ViewHostMsg_EnumerateDirectory( | 2260 return Send(new ViewHostMsg_EnumerateDirectory( |
| 2260 routing_id_, | 2261 routing_id_, |
| 2261 id, | 2262 id, |
| 2262 base::FilePath::FromUTF16Unsafe(path))); | 2263 base::FilePath::FromUTF16Unsafe(path))); |
| 2263 } | 2264 } |
| 2264 | 2265 |
| 2265 void RenderViewImpl::initializeHelperPluginWebFrame( | 2266 void RenderViewImpl::initializeHelperPluginWebFrame( |
| 2266 WebKit::WebHelperPlugin* plugin) { | 2267 WebKit::WebHelperPlugin* plugin) { |
| 2267 plugin->initializeFrame(this); | 2268 plugin->initializeFrame(main_render_frame_.get()); |
| 2268 } | 2269 } |
| 2269 | 2270 |
| 2270 void RenderViewImpl::didStartLoading() { | 2271 void RenderViewImpl::didStartLoading() { |
| 2271 if (is_loading_) { | 2272 if (is_loading_) { |
| 2272 DVLOG(1) << "didStartLoading called while loading"; | 2273 DVLOG(1) << "didStartLoading called while loading"; |
| 2273 return; | 2274 return; |
| 2274 } | 2275 } |
| 2275 | 2276 |
| 2276 is_loading_ = true; | 2277 is_loading_ = true; |
| 2277 | 2278 |
| (...skipping 4499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6777 WebURL url = icon_urls[i].iconURL(); | 6778 WebURL url = icon_urls[i].iconURL(); |
| 6778 if (!url.isEmpty()) | 6779 if (!url.isEmpty()) |
| 6779 urls.push_back(FaviconURL(url, | 6780 urls.push_back(FaviconURL(url, |
| 6780 ToFaviconType(icon_urls[i].iconType()))); | 6781 ToFaviconType(icon_urls[i].iconType()))); |
| 6781 } | 6782 } |
| 6782 SendUpdateFaviconURL(urls); | 6783 SendUpdateFaviconURL(urls); |
| 6783 } | 6784 } |
| 6784 | 6785 |
| 6785 | 6786 |
| 6786 } // namespace content | 6787 } // namespace content |
| OLD | NEW |