Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 212703005: Preserve Page::openedByDOM state across process swaps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: creis comments. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 785
786 if (switches::IsTouchDragDropEnabled()) 786 if (switches::IsTouchDragDropEnabled())
787 webview()->settings()->setTouchDragDropEnabled(true); 787 webview()->settings()->setTouchDragDropEnabled(true);
788 788
789 if (switches::IsTouchEditingEnabled()) 789 if (switches::IsTouchEditingEnabled())
790 webview()->settings()->setTouchEditingEnabled(true); 790 webview()->settings()->setTouchEditingEnabled(true);
791 791
792 if (!params->frame_name.empty()) 792 if (!params->frame_name.empty())
793 webview()->mainFrame()->setName(params->frame_name); 793 webview()->mainFrame()->setName(params->frame_name);
794 794
795 // TODO(davidben): Move this state from Blink into content.
796 if (params->window_was_created_with_opener)
797 webview()->setOpenedByDOM();
798
795 OnSetRendererPrefs(params->renderer_prefs); 799 OnSetRendererPrefs(params->renderer_prefs);
796 800
797 #if defined(ENABLE_WEBRTC) 801 #if defined(ENABLE_WEBRTC)
798 if (!media_stream_dispatcher_) 802 if (!media_stream_dispatcher_)
799 media_stream_dispatcher_ = new MediaStreamDispatcher(this); 803 media_stream_dispatcher_ = new MediaStreamDispatcher(this);
800 #endif 804 #endif
801 805
802 new MHTMLGenerator(this); 806 new MHTMLGenerator(this);
803 #if defined(OS_MACOSX) 807 #if defined(OS_MACOSX)
804 new TextInputClientObserver(this); 808 new TextInputClientObserver(this);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 ViewMap* views = g_view_map.Pointer(); 912 ViewMap* views = g_view_map.Pointer();
909 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) { 913 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) {
910 if (!visitor->Visit(it->second)) 914 if (!visitor->Visit(it->second))
911 return; 915 return;
912 } 916 }
913 } 917 }
914 918
915 /*static*/ 919 /*static*/
916 RenderViewImpl* RenderViewImpl::Create( 920 RenderViewImpl* RenderViewImpl::Create(
917 int32 opener_id, 921 int32 opener_id,
922 bool window_was_created_with_opener,
918 const RendererPreferences& renderer_prefs, 923 const RendererPreferences& renderer_prefs,
919 const WebPreferences& webkit_prefs, 924 const WebPreferences& webkit_prefs,
920 int32 routing_id, 925 int32 routing_id,
921 int32 main_frame_routing_id, 926 int32 main_frame_routing_id,
922 int32 surface_id, 927 int32 surface_id,
923 int64 session_storage_namespace_id, 928 int64 session_storage_namespace_id,
924 const base::string16& frame_name, 929 const base::string16& frame_name,
925 bool is_renderer_created, 930 bool is_renderer_created,
926 bool swapped_out, 931 bool swapped_out,
927 bool hidden, 932 bool hidden,
928 int32 next_page_id, 933 int32 next_page_id,
929 const blink::WebScreenInfo& screen_info, 934 const blink::WebScreenInfo& screen_info,
930 AccessibilityMode accessibility_mode) { 935 AccessibilityMode accessibility_mode) {
931 DCHECK(routing_id != MSG_ROUTING_NONE); 936 DCHECK(routing_id != MSG_ROUTING_NONE);
932 RenderViewImplParams params(opener_id, 937 RenderViewImplParams params(opener_id,
938 window_was_created_with_opener,
933 renderer_prefs, 939 renderer_prefs,
934 webkit_prefs, 940 webkit_prefs,
935 routing_id, 941 routing_id,
936 main_frame_routing_id, 942 main_frame_routing_id,
937 surface_id, 943 surface_id,
938 session_storage_namespace_id, 944 session_storage_namespace_id,
939 frame_name, 945 frame_name,
940 is_renderer_created, 946 is_renderer_created,
941 swapped_out, 947 swapped_out,
942 hidden, 948 hidden,
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 transferred_preferences.accelerated_compositing_enabled = true; 1563 transferred_preferences.accelerated_compositing_enabled = true;
1558 } 1564 }
1559 1565
1560 // The initial hidden state for the RenderViewImpl here has to match what the 1566 // The initial hidden state for the RenderViewImpl here has to match what the
1561 // browser will eventually decide for the given disposition. Since we have to 1567 // browser will eventually decide for the given disposition. Since we have to
1562 // return from this call synchronously, we just have to make our best guess 1568 // return from this call synchronously, we just have to make our best guess
1563 // and rely on the browser sending a WasHidden / WasShown message if it 1569 // and rely on the browser sending a WasHidden / WasShown message if it
1564 // disagrees. 1570 // disagrees.
1565 RenderViewImpl* view = RenderViewImpl::Create( 1571 RenderViewImpl* view = RenderViewImpl::Create(
1566 routing_id_, 1572 routing_id_,
1573 true, // window_was_created_with_opener
1567 renderer_preferences_, 1574 renderer_preferences_,
1568 transferred_preferences, 1575 transferred_preferences,
1569 routing_id, 1576 routing_id,
1570 main_frame_routing_id, 1577 main_frame_routing_id,
1571 surface_id, 1578 surface_id,
1572 cloned_session_storage_namespace_id, 1579 cloned_session_storage_namespace_id,
1573 base::string16(), // WebCore will take care of setting the correct name. 1580 base::string16(), // WebCore will take care of setting the correct name.
1574 true, // is_renderer_created 1581 true, // is_renderer_created
1575 false, // swapped_out 1582 false, // swapped_out
1576 params.disposition == NEW_BACKGROUND_TAB, // hidden 1583 params.disposition == NEW_BACKGROUND_TAB, // hidden
(...skipping 3250 matching lines...) Expand 10 before | Expand all | Expand 10 after
4827 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size()); 4834 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size());
4828 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4835 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4829 if (!url.isEmpty()) 4836 if (!url.isEmpty())
4830 urls.push_back( 4837 urls.push_back(
4831 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4838 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4832 } 4839 }
4833 SendUpdateFaviconURL(urls); 4840 SendUpdateFaviconURL(urls);
4834 } 4841 }
4835 4842
4836 } // namespace content 4843 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698