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

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: Rebase 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
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_view_impl_params.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 788
789 if (switches::IsTouchDragDropEnabled()) 789 if (switches::IsTouchDragDropEnabled())
790 webview()->settings()->setTouchDragDropEnabled(true); 790 webview()->settings()->setTouchDragDropEnabled(true);
791 791
792 if (switches::IsTouchEditingEnabled()) 792 if (switches::IsTouchEditingEnabled())
793 webview()->settings()->setTouchEditingEnabled(true); 793 webview()->settings()->setTouchEditingEnabled(true);
794 794
795 if (!params->frame_name.empty()) 795 if (!params->frame_name.empty())
796 webview()->mainFrame()->setName(params->frame_name); 796 webview()->mainFrame()->setName(params->frame_name);
797 797
798 // TODO(davidben): Move this state from Blink into content.
799 if (params->window_was_created_with_opener)
800 webview()->setOpenedByDOM();
801
798 OnSetRendererPrefs(params->renderer_prefs); 802 OnSetRendererPrefs(params->renderer_prefs);
799 803
800 #if defined(ENABLE_WEBRTC) 804 #if defined(ENABLE_WEBRTC)
801 if (!media_stream_dispatcher_) 805 if (!media_stream_dispatcher_)
802 media_stream_dispatcher_ = new MediaStreamDispatcher(this); 806 media_stream_dispatcher_ = new MediaStreamDispatcher(this);
803 #endif 807 #endif
804 808
805 new MHTMLGenerator(this); 809 new MHTMLGenerator(this);
806 #if defined(OS_MACOSX) 810 #if defined(OS_MACOSX)
807 new TextInputClientObserver(this); 811 new TextInputClientObserver(this);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 ViewMap* views = g_view_map.Pointer(); 917 ViewMap* views = g_view_map.Pointer();
914 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) { 918 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) {
915 if (!visitor->Visit(it->second)) 919 if (!visitor->Visit(it->second))
916 return; 920 return;
917 } 921 }
918 } 922 }
919 923
920 /*static*/ 924 /*static*/
921 RenderViewImpl* RenderViewImpl::Create( 925 RenderViewImpl* RenderViewImpl::Create(
922 int32 opener_id, 926 int32 opener_id,
927 bool window_was_created_with_opener,
923 const RendererPreferences& renderer_prefs, 928 const RendererPreferences& renderer_prefs,
924 const WebPreferences& webkit_prefs, 929 const WebPreferences& webkit_prefs,
925 int32 routing_id, 930 int32 routing_id,
926 int32 main_frame_routing_id, 931 int32 main_frame_routing_id,
927 int32 surface_id, 932 int32 surface_id,
928 int64 session_storage_namespace_id, 933 int64 session_storage_namespace_id,
929 const base::string16& frame_name, 934 const base::string16& frame_name,
930 bool is_renderer_created, 935 bool is_renderer_created,
931 bool swapped_out, 936 bool swapped_out,
932 bool hidden, 937 bool hidden,
933 bool never_visible, 938 bool never_visible,
934 int32 next_page_id, 939 int32 next_page_id,
935 const blink::WebScreenInfo& screen_info, 940 const blink::WebScreenInfo& screen_info,
936 AccessibilityMode accessibility_mode) { 941 AccessibilityMode accessibility_mode) {
937 DCHECK(routing_id != MSG_ROUTING_NONE); 942 DCHECK(routing_id != MSG_ROUTING_NONE);
938 RenderViewImplParams params(opener_id, 943 RenderViewImplParams params(opener_id,
944 window_was_created_with_opener,
939 renderer_prefs, 945 renderer_prefs,
940 webkit_prefs, 946 webkit_prefs,
941 routing_id, 947 routing_id,
942 main_frame_routing_id, 948 main_frame_routing_id,
943 surface_id, 949 surface_id,
944 session_storage_namespace_id, 950 session_storage_namespace_id,
945 frame_name, 951 frame_name,
946 is_renderer_created, 952 is_renderer_created,
947 swapped_out, 953 swapped_out,
948 hidden, 954 hidden,
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 // TODO(vangelis): Can we tell if the new view will be a background page? 1524 // TODO(vangelis): Can we tell if the new view will be a background page?
1519 bool never_visible = false; 1525 bool never_visible = false;
1520 1526
1521 // The initial hidden state for the RenderViewImpl here has to match what the 1527 // The initial hidden state for the RenderViewImpl here has to match what the
1522 // browser will eventually decide for the given disposition. Since we have to 1528 // browser will eventually decide for the given disposition. Since we have to
1523 // return from this call synchronously, we just have to make our best guess 1529 // return from this call synchronously, we just have to make our best guess
1524 // and rely on the browser sending a WasHidden / WasShown message if it 1530 // and rely on the browser sending a WasHidden / WasShown message if it
1525 // disagrees. 1531 // disagrees.
1526 RenderViewImpl* view = RenderViewImpl::Create( 1532 RenderViewImpl* view = RenderViewImpl::Create(
1527 routing_id_, 1533 routing_id_,
1534 true, // window_was_created_with_opener
1528 renderer_preferences_, 1535 renderer_preferences_,
1529 webkit_preferences_, 1536 webkit_preferences_,
1530 routing_id, 1537 routing_id,
1531 main_frame_routing_id, 1538 main_frame_routing_id,
1532 surface_id, 1539 surface_id,
1533 cloned_session_storage_namespace_id, 1540 cloned_session_storage_namespace_id,
1534 base::string16(), // WebCore will take care of setting the correct name. 1541 base::string16(), // WebCore will take care of setting the correct name.
1535 true, // is_renderer_created 1542 true, // is_renderer_created
1536 false, // swapped_out 1543 false, // swapped_out
1537 params.disposition == NEW_BACKGROUND_TAB, // hidden 1544 params.disposition == NEW_BACKGROUND_TAB, // hidden
(...skipping 2987 matching lines...) Expand 10 before | Expand all | Expand 10 after
4525 std::vector<gfx::Size> sizes; 4532 std::vector<gfx::Size> sizes;
4526 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4533 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4527 if (!url.isEmpty()) 4534 if (!url.isEmpty())
4528 urls.push_back( 4535 urls.push_back(
4529 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4536 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4530 } 4537 }
4531 SendUpdateFaviconURL(urls); 4538 SendUpdateFaviconURL(urls);
4532 } 4539 }
4533 4540
4534 } // namespace content 4541 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_view_impl_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698