| 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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 enumeration_completion_id_(0), | 826 enumeration_completion_id_(0), |
| 827 load_progress_tracker_(new LoadProgressTracker(this)), | 827 load_progress_tracker_(new LoadProgressTracker(this)), |
| 828 session_storage_namespace_id_(params->session_storage_namespace_id), | 828 session_storage_namespace_id_(params->session_storage_namespace_id), |
| 829 handling_select_range_(false), | 829 handling_select_range_(false), |
| 830 next_snapshot_id_(0), | 830 next_snapshot_id_(0), |
| 831 allow_partial_swap_(params->allow_partial_swap), | 831 allow_partial_swap_(params->allow_partial_swap), |
| 832 context_menu_source_type_(ui::MENU_SOURCE_MOUSE) { | 832 context_menu_source_type_(ui::MENU_SOURCE_MOUSE) { |
| 833 } | 833 } |
| 834 | 834 |
| 835 void RenderViewImpl::Initialize(RenderViewImplParams* params) { | 835 void RenderViewImpl::Initialize(RenderViewImplParams* params) { |
| 836 RenderFrameImpl* main_frame = RenderFrameImpl::Create( | |
| 837 this, params->main_frame_routing_id); | |
| 838 main_render_frame_.reset(main_frame); | |
| 839 routing_id_ = params->routing_id; | 836 routing_id_ = params->routing_id; |
| 840 surface_id_ = params->surface_id; | 837 surface_id_ = params->surface_id; |
| 841 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) | 838 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) |
| 842 opener_id_ = params->opener_id; | 839 opener_id_ = params->opener_id; |
| 843 | 840 |
| 844 // Ensure we start with a valid next_page_id_ from the browser. | 841 // Ensure we start with a valid next_page_id_ from the browser. |
| 845 DCHECK_GE(next_page_id_, 0); | 842 DCHECK_GE(next_page_id_, 0); |
| 846 | 843 |
| 847 #if defined(ENABLE_NOTIFICATIONS) | 844 #if defined(ENABLE_NOTIFICATIONS) |
| 848 notification_provider_ = new NotificationProvider(this); | 845 notification_provider_ = new NotificationProvider(this); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( | 890 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( |
| 894 ShouldUseFixedPositionCompositing(device_scale_factor_)); | 891 ShouldUseFixedPositionCompositing(device_scale_factor_)); |
| 895 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( | 892 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( |
| 896 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); | 893 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); |
| 897 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( | 894 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( |
| 898 ShouldUseTransitionCompositing(device_scale_factor_)); | 895 ShouldUseTransitionCompositing(device_scale_factor_)); |
| 899 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( | 896 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( |
| 900 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); | 897 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); |
| 901 | 898 |
| 902 ApplyWebPreferences(webkit_preferences_, webview()); | 899 ApplyWebPreferences(webkit_preferences_, webview()); |
| 903 webview()->initializeMainFrame(main_render_frame_.get()); | 900 |
| 901 main_render_frame_.reset( |
| 902 RenderFrameImpl::Create(this, params->main_frame_routing_id)); |
| 903 // The main frame WebFrame object is closed by |
| 904 // RenderViewImpl::frameDetached(). |
| 905 webview()->setMainFrame(WebFrame::create(main_render_frame_.get())); |
| 904 | 906 |
| 905 if (switches::IsTouchDragDropEnabled()) | 907 if (switches::IsTouchDragDropEnabled()) |
| 906 webview()->settings()->setTouchDragDropEnabled(true); | 908 webview()->settings()->setTouchDragDropEnabled(true); |
| 907 | 909 |
| 908 if (switches::IsTouchEditingEnabled()) | 910 if (switches::IsTouchEditingEnabled()) |
| 909 webview()->settings()->setTouchEditingEnabled(true); | 911 webview()->settings()->setTouchEditingEnabled(true); |
| 910 | 912 |
| 911 if (!params->frame_name.empty()) | 913 if (!params->frame_name.empty()) |
| 912 webview()->mainFrame()->setName(params->frame_name); | 914 webview()->mainFrame()->setName(params->frame_name); |
| 913 | 915 |
| (...skipping 5609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6523 for (size_t i = 0; i < icon_urls.size(); i++) { | 6525 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 6524 WebURL url = icon_urls[i].iconURL(); | 6526 WebURL url = icon_urls[i].iconURL(); |
| 6525 if (!url.isEmpty()) | 6527 if (!url.isEmpty()) |
| 6526 urls.push_back(FaviconURL(url, | 6528 urls.push_back(FaviconURL(url, |
| 6527 ToFaviconType(icon_urls[i].iconType()))); | 6529 ToFaviconType(icon_urls[i].iconType()))); |
| 6528 } | 6530 } |
| 6529 SendUpdateFaviconURL(urls); | 6531 SendUpdateFaviconURL(urls); |
| 6530 } | 6532 } |
| 6531 | 6533 |
| 6532 } // namespace content | 6534 } // namespace content |
| OLD | NEW |