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

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: nasko comments. (Also a rebase. Oops.) 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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 784
785 if (switches::IsTouchDragDropEnabled()) 785 if (switches::IsTouchDragDropEnabled())
786 webview()->settings()->setTouchDragDropEnabled(true); 786 webview()->settings()->setTouchDragDropEnabled(true);
787 787
788 if (switches::IsTouchEditingEnabled()) 788 if (switches::IsTouchEditingEnabled())
789 webview()->settings()->setTouchEditingEnabled(true); 789 webview()->settings()->setTouchEditingEnabled(true);
790 790
791 if (!params->frame_name.empty()) 791 if (!params->frame_name.empty())
792 webview()->mainFrame()->setName(params->frame_name); 792 webview()->mainFrame()->setName(params->frame_name);
793 793
794 // TODO(davidben): Move this state from Blink into content.
795 if (params->window_was_created_with_opener)
796 webview()->setOpenedByDOM();
797
794 OnSetRendererPrefs(params->renderer_prefs); 798 OnSetRendererPrefs(params->renderer_prefs);
795 799
796 #if defined(ENABLE_WEBRTC) 800 #if defined(ENABLE_WEBRTC)
797 if (!media_stream_dispatcher_) 801 if (!media_stream_dispatcher_)
798 media_stream_dispatcher_ = new MediaStreamDispatcher(this); 802 media_stream_dispatcher_ = new MediaStreamDispatcher(this);
799 #endif 803 #endif
800 804
801 new MHTMLGenerator(this); 805 new MHTMLGenerator(this);
802 #if defined(OS_MACOSX) 806 #if defined(OS_MACOSX)
803 new TextInputClientObserver(this); 807 new TextInputClientObserver(this);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 ViewMap* views = g_view_map.Pointer(); 911 ViewMap* views = g_view_map.Pointer();
908 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) { 912 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) {
909 if (!visitor->Visit(it->second)) 913 if (!visitor->Visit(it->second))
910 return; 914 return;
911 } 915 }
912 } 916 }
913 917
914 /*static*/ 918 /*static*/
915 RenderViewImpl* RenderViewImpl::Create( 919 RenderViewImpl* RenderViewImpl::Create(
916 int32 opener_id, 920 int32 opener_id,
921 bool window_was_created_with_opener,
917 const RendererPreferences& renderer_prefs, 922 const RendererPreferences& renderer_prefs,
918 const WebPreferences& webkit_prefs, 923 const WebPreferences& webkit_prefs,
919 int32 routing_id, 924 int32 routing_id,
920 int32 main_frame_routing_id, 925 int32 main_frame_routing_id,
921 int32 surface_id, 926 int32 surface_id,
922 int64 session_storage_namespace_id, 927 int64 session_storage_namespace_id,
923 const base::string16& frame_name, 928 const base::string16& frame_name,
924 bool is_renderer_created, 929 bool is_renderer_created,
925 bool swapped_out, 930 bool swapped_out,
926 bool hidden, 931 bool hidden,
927 int32 next_page_id, 932 int32 next_page_id,
928 const blink::WebScreenInfo& screen_info, 933 const blink::WebScreenInfo& screen_info,
929 AccessibilityMode accessibility_mode) { 934 AccessibilityMode accessibility_mode) {
930 DCHECK(routing_id != MSG_ROUTING_NONE); 935 DCHECK(routing_id != MSG_ROUTING_NONE);
931 RenderViewImplParams params(opener_id, 936 RenderViewImplParams params(opener_id,
937 window_was_created_with_opener,
932 renderer_prefs, 938 renderer_prefs,
933 webkit_prefs, 939 webkit_prefs,
934 routing_id, 940 routing_id,
935 main_frame_routing_id, 941 main_frame_routing_id,
936 surface_id, 942 surface_id,
937 session_storage_namespace_id, 943 session_storage_namespace_id,
938 frame_name, 944 frame_name,
939 is_renderer_created, 945 is_renderer_created,
940 swapped_out, 946 swapped_out,
941 hidden, 947 hidden,
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 transferred_preferences.accelerated_compositing_enabled = true; 1537 transferred_preferences.accelerated_compositing_enabled = true;
1532 } 1538 }
1533 1539
1534 // The initial hidden state for the RenderViewImpl here has to match what the 1540 // The initial hidden state for the RenderViewImpl here has to match what the
1535 // browser will eventually decide for the given disposition. Since we have to 1541 // browser will eventually decide for the given disposition. Since we have to
1536 // return from this call synchronously, we just have to make our best guess 1542 // return from this call synchronously, we just have to make our best guess
1537 // and rely on the browser sending a WasHidden / WasShown message if it 1543 // and rely on the browser sending a WasHidden / WasShown message if it
1538 // disagrees. 1544 // disagrees.
1539 RenderViewImpl* view = RenderViewImpl::Create( 1545 RenderViewImpl* view = RenderViewImpl::Create(
1540 routing_id_, 1546 routing_id_,
1547 true, // window_was_created_with_opener
1541 renderer_preferences_, 1548 renderer_preferences_,
1542 transferred_preferences, 1549 transferred_preferences,
1543 routing_id, 1550 routing_id,
1544 main_frame_routing_id, 1551 main_frame_routing_id,
1545 surface_id, 1552 surface_id,
1546 cloned_session_storage_namespace_id, 1553 cloned_session_storage_namespace_id,
1547 base::string16(), // WebCore will take care of setting the correct name. 1554 base::string16(), // WebCore will take care of setting the correct name.
1548 true, // is_renderer_created 1555 true, // is_renderer_created
1549 false, // swapped_out 1556 false, // swapped_out
1550 params.disposition == NEW_BACKGROUND_TAB, // hidden 1557 params.disposition == NEW_BACKGROUND_TAB, // hidden
(...skipping 3199 matching lines...) Expand 10 before | Expand all | Expand 10 after
4750 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size()); 4757 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size());
4751 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4758 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4752 if (!url.isEmpty()) 4759 if (!url.isEmpty())
4753 urls.push_back( 4760 urls.push_back(
4754 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4761 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4755 } 4762 }
4756 SendUpdateFaviconURL(urls); 4763 SendUpdateFaviconURL(urls);
4757 } 4764 }
4758 4765
4759 } // namespace content 4766 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698