Chromium Code Reviews| 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 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 828 enumeration_completion_id_(0), | 828 enumeration_completion_id_(0), |
| 829 load_progress_tracker_(new LoadProgressTracker(this)), | 829 load_progress_tracker_(new LoadProgressTracker(this)), |
| 830 session_storage_namespace_id_(params->session_storage_namespace_id), | 830 session_storage_namespace_id_(params->session_storage_namespace_id), |
| 831 handling_select_range_(false), | 831 handling_select_range_(false), |
| 832 next_snapshot_id_(0), | 832 next_snapshot_id_(0), |
| 833 allow_partial_swap_(params->allow_partial_swap), | 833 allow_partial_swap_(params->allow_partial_swap), |
| 834 context_menu_source_type_(ui::MENU_SOURCE_MOUSE) { | 834 context_menu_source_type_(ui::MENU_SOURCE_MOUSE) { |
| 835 } | 835 } |
| 836 | 836 |
| 837 void RenderViewImpl::Initialize(RenderViewImplParams* params) { | 837 void RenderViewImpl::Initialize(RenderViewImplParams* params) { |
| 838 RenderFrameImpl* main_frame = RenderFrameImpl::Create( | |
| 839 this, params->main_frame_routing_id); | |
| 840 main_render_frame_.reset(main_frame); | |
| 841 routing_id_ = params->routing_id; | 838 routing_id_ = params->routing_id; |
| 842 surface_id_ = params->surface_id; | 839 surface_id_ = params->surface_id; |
| 843 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) | 840 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) |
| 844 opener_id_ = params->opener_id; | 841 opener_id_ = params->opener_id; |
| 845 | 842 |
| 846 // Ensure we start with a valid next_page_id_ from the browser. | 843 // Ensure we start with a valid next_page_id_ from the browser. |
| 847 DCHECK_GE(next_page_id_, 0); | 844 DCHECK_GE(next_page_id_, 0); |
| 848 | 845 |
| 849 #if defined(ENABLE_NOTIFICATIONS) | 846 #if defined(ENABLE_NOTIFICATIONS) |
| 850 notification_provider_ = new NotificationProvider(this); | 847 notification_provider_ = new NotificationProvider(this); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 895 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( | 892 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( |
| 896 ShouldUseFixedPositionCompositing(device_scale_factor_)); | 893 ShouldUseFixedPositionCompositing(device_scale_factor_)); |
| 897 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( | 894 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( |
| 898 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); | 895 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); |
| 899 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( | 896 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( |
| 900 ShouldUseTransitionCompositing(device_scale_factor_)); | 897 ShouldUseTransitionCompositing(device_scale_factor_)); |
| 901 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( | 898 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( |
| 902 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); | 899 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); |
| 903 | 900 |
| 904 ApplyWebPreferences(webkit_preferences_, webview()); | 901 ApplyWebPreferences(webkit_preferences_, webview()); |
| 905 webview()->initializeMainFrame(main_render_frame_.get()); | 902 main_render_frame_.reset( |
|
Charlie Reis
2013/09/27 19:19:21
nit: Add blank line before, now that we have a blo
awong
2013/09/27 20:50:09
Done.
| |
| 903 RenderFrameImpl::Create(this, params->main_frame_routing_id)); | |
| 904 // The main frame WebFrame object is closed by | |
| 905 // RenderViewImpl::frameDetached(). | |
| 906 webview()->setMainFrame(WebFrame::create(main_render_frame_.get())); | |
| 906 | 907 |
| 907 if (switches::IsTouchDragDropEnabled()) | 908 if (switches::IsTouchDragDropEnabled()) |
| 908 webview()->settings()->setTouchDragDropEnabled(true); | 909 webview()->settings()->setTouchDragDropEnabled(true); |
| 909 | 910 |
| 910 if (switches::IsTouchEditingEnabled()) | 911 if (switches::IsTouchEditingEnabled()) |
| 911 webview()->settings()->setTouchEditingEnabled(true); | 912 webview()->settings()->setTouchEditingEnabled(true); |
| 912 | 913 |
| 913 if (!params->frame_name.empty()) | 914 if (!params->frame_name.empty()) |
| 914 webview()->mainFrame()->setName(params->frame_name); | 915 webview()->mainFrame()->setName(params->frame_name); |
| 915 | 916 |
| (...skipping 5588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6504 for (size_t i = 0; i < icon_urls.size(); i++) { | 6505 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 6505 WebURL url = icon_urls[i].iconURL(); | 6506 WebURL url = icon_urls[i].iconURL(); |
| 6506 if (!url.isEmpty()) | 6507 if (!url.isEmpty()) |
| 6507 urls.push_back(FaviconURL(url, | 6508 urls.push_back(FaviconURL(url, |
| 6508 ToFaviconType(icon_urls[i].iconType()))); | 6509 ToFaviconType(icon_urls[i].iconType()))); |
| 6509 } | 6510 } |
| 6510 SendUpdateFaviconURL(urls); | 6511 SendUpdateFaviconURL(urls); |
| 6511 } | 6512 } |
| 6512 | 6513 |
| 6513 } // namespace content | 6514 } // namespace content |
| OLD | NEW |