Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 790 IPC_MESSAGE_HANDLER(FrameMsg_SetupTransitionView, OnSetupTransitionView) | 790 IPC_MESSAGE_HANDLER(FrameMsg_SetupTransitionView, OnSetupTransitionView) |
| 791 IPC_MESSAGE_HANDLER(FrameMsg_BeginExitTransition, OnBeginExitTransition) | 791 IPC_MESSAGE_HANDLER(FrameMsg_BeginExitTransition, OnBeginExitTransition) |
| 792 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) | 792 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) |
| 793 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, | 793 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, |
| 794 OnTextSurroundingSelectionRequest) | 794 OnTextSurroundingSelectionRequest) |
| 795 IPC_MESSAGE_HANDLER(FrameMsg_AddStyleSheetByURL, | 795 IPC_MESSAGE_HANDLER(FrameMsg_AddStyleSheetByURL, |
| 796 OnAddStyleSheetByURL) | 796 OnAddStyleSheetByURL) |
| 797 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, | 797 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, |
| 798 OnSetAccessibilityMode) | 798 OnSetAccessibilityMode) |
| 799 IPC_MESSAGE_HANDLER(FrameMsg_DisownOpener, OnDisownOpener) | 799 IPC_MESSAGE_HANDLER(FrameMsg_DisownOpener, OnDisownOpener) |
| 800 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) | |
| 800 #if defined(OS_ANDROID) | 801 #if defined(OS_ANDROID) |
| 801 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) | 802 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) |
| 802 #elif defined(OS_MACOSX) | 803 #elif defined(OS_MACOSX) |
| 803 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) | 804 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) |
| 804 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) | 805 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) |
| 805 #endif | 806 #endif |
| 806 IPC_END_MESSAGE_MAP() | 807 IPC_END_MESSAGE_MAP() |
| 807 | 808 |
| 808 return handled; | 809 return handled; |
| 809 } | 810 } |
| 810 | 811 |
| 811 void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) { | 812 void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) { |
| 812 TRACE_EVENT2("navigation", "RenderFrameImpl::OnNavigate", | 813 TRACE_EVENT2("navigation", |
| 813 "id", routing_id_, "url", params.url.possibly_invalid_spec()); | 814 "RenderFrameImpl::OnNavigate", |
| 814 MaybeHandleDebugURL(params.url); | 815 "id", |
| 816 routing_id_, | |
| 817 "url", | |
|
Charlie Reis
2014/09/19 23:12:32
nit: These don't need to be wrapped one-per-line.
clamy
2014/09/23 21:13:26
Done.
| |
| 818 params.core_params.url.possibly_invalid_spec()); | |
| 819 MaybeHandleDebugURL(params.core_params.url); | |
| 815 if (!render_view_->webview()) | 820 if (!render_view_->webview()) |
| 816 return; | 821 return; |
| 817 | 822 |
| 818 FOR_EACH_OBSERVER( | 823 FOR_EACH_OBSERVER(RenderViewObserver, |
| 819 RenderViewObserver, render_view_->observers_, Navigate(params.url)); | 824 render_view_->observers_, |
| 825 Navigate(params.core_params.url)); | |
| 820 | 826 |
| 821 bool is_reload = RenderViewImpl::IsReload(params); | 827 bool is_reload = RenderViewImpl::IsReload(params.core_params.navigation_type); |
| 822 WebURLRequest::CachePolicy cache_policy = | 828 WebURLRequest::CachePolicy cache_policy = |
| 823 WebURLRequest::UseProtocolCachePolicy; | 829 WebURLRequest::UseProtocolCachePolicy; |
| 824 | 830 |
| 825 // If this is a stale back/forward (due to a recent navigation the browser | 831 // If this is a stale back/forward (due to a recent navigation the browser |
| 826 // didn't know about), ignore it. | 832 // didn't know about), ignore it. |
| 827 if (render_view_->IsBackForwardToStaleEntry(params, is_reload)) | 833 if (render_view_->IsBackForwardToStaleEntry(params.commit_params, is_reload)) |
| 828 return; | 834 return; |
| 829 | 835 |
| 830 // Swap this renderer back in if necessary. | 836 // Swap this renderer back in if necessary. |
| 831 if (render_view_->is_swapped_out_ && | 837 if (render_view_->is_swapped_out_ && |
| 832 GetWebFrame() == render_view_->webview()->mainFrame()) { | 838 GetWebFrame() == render_view_->webview()->mainFrame()) { |
| 833 // We marked the view as hidden when swapping the view out, so be sure to | 839 // We marked the view as hidden when swapping the view out, so be sure to |
| 834 // reset the visibility state before navigating to the new URL. | 840 // reset the visibility state before navigating to the new URL. |
| 835 render_view_->webview()->setVisibilityState( | 841 render_view_->webview()->setVisibilityState( |
| 836 render_view_->visibilityState(), false); | 842 render_view_->visibilityState(), false); |
| 837 | 843 |
| 838 // If this is an attempt to reload while we are swapped out, we should not | 844 // If this is an attempt to reload while we are swapped out, we should not |
| 839 // reload swappedout://, but the previous page, which is stored in | 845 // reload swappedout://, but the previous page, which is stored in |
| 840 // params.state. Setting is_reload to false will treat this like a back | 846 // params.state. Setting is_reload to false will treat this like a back |
| 841 // navigation to accomplish that. | 847 // navigation to accomplish that. |
| 842 is_reload = false; | 848 is_reload = false; |
| 843 cache_policy = WebURLRequest::ReloadIgnoringCacheData; | 849 cache_policy = WebURLRequest::ReloadIgnoringCacheData; |
| 844 | 850 |
| 845 // We refresh timezone when a view is swapped in since timezone | 851 // We refresh timezone when a view is swapped in since timezone |
| 846 // can get out of sync when the system timezone is updated while | 852 // can get out of sync when the system timezone is updated while |
| 847 // the view is swapped out. | 853 // the view is swapped out. |
| 848 RenderThreadImpl::NotifyTimezoneChange(); | 854 RenderThreadImpl::NotifyTimezoneChange(); |
| 849 | 855 |
| 850 render_view_->SetSwappedOut(false); | 856 render_view_->SetSwappedOut(false); |
| 851 is_swapped_out_ = false; | 857 is_swapped_out_ = false; |
| 852 } | 858 } |
| 853 | 859 |
| 854 if (params.should_clear_history_list) { | 860 int pending_history_list_offset = |
| 855 CHECK_EQ(params.pending_history_list_offset, -1); | 861 params.commit_params.pending_history_list_offset; |
|
nasko
2014/09/22 23:13:04
This method is starting a browser initiated naviga
clamy
2014/09/23 21:13:26
History params are no longer part of CommitParams.
| |
| 856 CHECK_EQ(params.current_history_list_offset, -1); | 862 int current_history_list_offset = |
| 857 CHECK_EQ(params.current_history_list_length, 0); | 863 params.commit_params.current_history_list_offset; |
| 864 int current_history_list_length = | |
| 865 params.commit_params.current_history_list_length; | |
| 866 if (params.commit_params.should_clear_history_list) { | |
| 867 CHECK_EQ(pending_history_list_offset, -1); | |
| 868 CHECK_EQ(current_history_list_offset, -1); | |
| 869 CHECK_EQ(current_history_list_length, 0); | |
| 858 } | 870 } |
| 859 render_view_->history_list_offset_ = params.current_history_list_offset; | 871 render_view_->history_list_offset_ = current_history_list_offset; |
| 860 render_view_->history_list_length_ = params.current_history_list_length; | 872 render_view_->history_list_length_ = current_history_list_length; |
| 861 if (render_view_->history_list_length_ >= 0) { | 873 if (render_view_->history_list_length_ >= 0) { |
| 862 render_view_->history_page_ids_.resize( | 874 render_view_->history_page_ids_.resize( |
| 863 render_view_->history_list_length_, -1); | 875 render_view_->history_list_length_, -1); |
| 864 } | 876 } |
| 865 if (params.pending_history_list_offset >= 0 && | 877 if (pending_history_list_offset >= 0 && |
| 866 params.pending_history_list_offset < render_view_->history_list_length_) { | 878 pending_history_list_offset < render_view_->history_list_length_) { |
| 867 render_view_->history_page_ids_[params.pending_history_list_offset] = | 879 render_view_->history_page_ids_[pending_history_list_offset] = |
| 868 params.page_id; | 880 params.commit_params.page_id; |
| 869 } | 881 } |
| 870 | 882 |
| 871 GetContentClient()->SetActiveURL(params.url); | 883 GetContentClient()->SetActiveURL(params.core_params.url); |
| 872 | 884 |
| 873 WebFrame* frame = frame_; | 885 WebFrame* frame = frame_; |
| 874 if (!params.frame_to_navigate.empty()) { | 886 if (!params.frame_to_navigate.empty()) { |
| 875 // TODO(nasko): Move this lookup to the browser process. | 887 // TODO(nasko): Move this lookup to the browser process. |
| 876 frame = render_view_->webview()->findFrameByName( | 888 frame = render_view_->webview()->findFrameByName( |
| 877 WebString::fromUTF8(params.frame_to_navigate)); | 889 WebString::fromUTF8(params.frame_to_navigate)); |
| 878 CHECK(frame) << "Invalid frame name passed: " << params.frame_to_navigate; | 890 CHECK(frame) << "Invalid frame name passed: " << params.frame_to_navigate; |
| 879 } | 891 } |
| 880 | 892 |
| 881 if (is_reload && !render_view_->history_controller()->GetCurrentEntry()) { | 893 if (is_reload && !render_view_->history_controller()->GetCurrentEntry()) { |
| 882 // We cannot reload if we do not have any history state. This happens, for | 894 // We cannot reload if we do not have any history state. This happens, for |
| 883 // example, when recovering from a crash. | 895 // example, when recovering from a crash. |
| 884 is_reload = false; | 896 is_reload = false; |
| 885 cache_policy = WebURLRequest::ReloadIgnoringCacheData; | 897 cache_policy = WebURLRequest::ReloadIgnoringCacheData; |
| 886 } | 898 } |
| 887 | 899 |
| 888 render_view_->pending_navigation_params_.reset( | 900 render_view_->pending_navigation_params_.reset( |
| 889 new FrameMsg_Navigate_Params(params)); | 901 new FrameMsg_Navigate_Params(params)); |
| 890 | 902 |
| 891 // If we are reloading, then WebKit will use the history state of the current | 903 // If we are reloading, then WebKit will use the history state of the current |
| 892 // page, so we should just ignore any given history state. Otherwise, if we | 904 // page, so we should just ignore any given history state. Otherwise, if we |
| 893 // have history state, then we need to navigate to it, which corresponds to a | 905 // have history state, then we need to navigate to it, which corresponds to a |
| 894 // back/forward navigation event. | 906 // back/forward navigation event. |
| 895 if (is_reload) { | 907 if (is_reload) { |
| 896 bool reload_original_url = | 908 bool reload_original_url = |
| 897 (params.navigation_type == | 909 (params.core_params.navigation_type == |
| 898 FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL); | 910 FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL); |
| 899 bool ignore_cache = (params.navigation_type == | 911 bool ignore_cache = (params.core_params.navigation_type == |
| 900 FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE); | 912 FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE); |
| 901 | 913 |
| 902 if (reload_original_url) | 914 if (reload_original_url) |
| 903 frame->reloadWithOverrideURL(params.url, true); | 915 frame->reloadWithOverrideURL(params.core_params.url, true); |
| 904 else | 916 else |
| 905 frame->reload(ignore_cache); | 917 frame->reload(ignore_cache); |
| 906 } else if (params.page_state.IsValid()) { | 918 } else if (params.commit_params.page_state.IsValid()) { |
| 907 // We must know the page ID of the page we are navigating back to. | 919 // We must know the page ID of the page we are navigating back to. |
| 908 DCHECK_NE(params.page_id, -1); | 920 DCHECK_NE(params.commit_params.page_id, -1); |
| 909 scoped_ptr<HistoryEntry> entry = | 921 scoped_ptr<HistoryEntry> entry = |
| 910 PageStateToHistoryEntry(params.page_state); | 922 PageStateToHistoryEntry(params.commit_params.page_state); |
| 911 if (entry) { | 923 if (entry) { |
| 912 // Ensure we didn't save the swapped out URL in UpdateState, since the | 924 // Ensure we didn't save the swapped out URL in UpdateState, since the |
| 913 // browser should never be telling us to navigate to swappedout://. | 925 // browser should never be telling us to navigate to swappedout://. |
| 914 CHECK(entry->root().urlString() != WebString::fromUTF8(kSwappedOutURL)); | 926 CHECK(entry->root().urlString() != WebString::fromUTF8(kSwappedOutURL)); |
| 915 render_view_->history_controller()->GoToEntry(entry.Pass(), cache_policy); | 927 render_view_->history_controller()->GoToEntry(entry.Pass(), cache_policy); |
| 916 } | 928 } |
| 917 } else if (!params.base_url_for_data_url.is_empty()) { | 929 } else if (!params.base_url_for_data_url.is_empty()) { |
| 918 // A loadData request with a specified base URL. | 930 // A loadData request with a specified base URL. |
| 919 std::string mime_type, charset, data; | 931 std::string mime_type, charset, data; |
| 920 if (net::DataURL::Parse(params.url, &mime_type, &charset, &data)) { | 932 if (net::DataURL::Parse( |
| 933 params.core_params.url, &mime_type, &charset, &data)) { | |
| 921 frame->loadData( | 934 frame->loadData( |
| 922 WebData(data.c_str(), data.length()), | 935 WebData(data.c_str(), data.length()), |
| 923 WebString::fromUTF8(mime_type), | 936 WebString::fromUTF8(mime_type), |
| 924 WebString::fromUTF8(charset), | 937 WebString::fromUTF8(charset), |
| 925 params.base_url_for_data_url, | 938 params.base_url_for_data_url, |
| 926 params.history_url_for_data_url, | 939 params.history_url_for_data_url, |
| 927 false); | 940 false); |
| 928 } else { | 941 } else { |
| 929 CHECK(false) << | 942 CHECK(false) << "Invalid URL passed: " |
| 930 "Invalid URL passed: " << params.url.possibly_invalid_spec(); | 943 << params.core_params.url.possibly_invalid_spec(); |
| 931 } | 944 } |
| 932 } else { | 945 } else { |
| 933 // Navigate to the given URL. | 946 // Navigate to the given URL. |
| 934 WebURLRequest request(params.url); | 947 WebURLRequest request(params.core_params.url); |
| 935 | 948 |
| 936 // A session history navigation should have been accompanied by state. | 949 // A session history navigation should have been accompanied by state. |
| 937 CHECK_EQ(params.page_id, -1); | 950 CHECK_EQ(params.commit_params.page_id, -1); |
| 938 | 951 |
| 939 if (frame->isViewSourceModeEnabled()) | 952 if (frame->isViewSourceModeEnabled()) |
| 940 request.setCachePolicy(WebURLRequest::ReturnCacheDataElseLoad); | 953 request.setCachePolicy(WebURLRequest::ReturnCacheDataElseLoad); |
| 941 | 954 |
| 942 if (params.referrer.url.is_valid()) { | 955 if (params.core_params.referrer.url.is_valid()) { |
| 943 WebString referrer = WebSecurityPolicy::generateReferrerHeader( | 956 WebString referrer = WebSecurityPolicy::generateReferrerHeader( |
| 944 params.referrer.policy, | 957 params.core_params.referrer.policy, |
| 945 params.url, | 958 params.core_params.url, |
| 946 WebString::fromUTF8(params.referrer.url.spec())); | 959 WebString::fromUTF8(params.core_params.referrer.url.spec())); |
| 947 if (!referrer.isEmpty()) | 960 if (!referrer.isEmpty()) |
| 948 request.setHTTPReferrer(referrer, params.referrer.policy); | 961 request.setHTTPReferrer(referrer, params.core_params.referrer.policy); |
| 949 } | 962 } |
| 950 | 963 |
| 951 if (!params.extra_headers.empty()) { | 964 if (!params.request_params.extra_headers.empty()) { |
| 952 for (net::HttpUtil::HeadersIterator i(params.extra_headers.begin(), | 965 for (net::HttpUtil::HeadersIterator i( |
| 953 params.extra_headers.end(), "\n"); | 966 params.request_params.extra_headers.begin(), |
| 954 i.GetNext(); ) { | 967 params.request_params.extra_headers.end(), |
| 968 "\n"); | |
| 969 i.GetNext();) { | |
| 955 request.addHTTPHeaderField(WebString::fromUTF8(i.name()), | 970 request.addHTTPHeaderField(WebString::fromUTF8(i.name()), |
| 956 WebString::fromUTF8(i.values())); | 971 WebString::fromUTF8(i.values())); |
| 957 } | 972 } |
| 958 } | 973 } |
| 959 | 974 |
| 960 if (params.is_post) { | 975 if (params.request_params.is_post) { |
| 961 request.setHTTPMethod(WebString::fromUTF8("POST")); | 976 request.setHTTPMethod(WebString::fromUTF8("POST")); |
| 962 | 977 |
| 963 // Set post data. | 978 // Set post data. |
| 964 WebHTTPBody http_body; | 979 WebHTTPBody http_body; |
| 965 http_body.initialize(); | 980 http_body.initialize(); |
| 966 const char* data = NULL; | 981 const char* data = NULL; |
| 967 if (params.browser_initiated_post_data.size()) { | 982 if (params.request_params.browser_initiated_post_data.size()) { |
| 968 data = reinterpret_cast<const char*>( | 983 data = reinterpret_cast<const char*>( |
| 969 ¶ms.browser_initiated_post_data.front()); | 984 ¶ms.request_params.browser_initiated_post_data.front()); |
| 970 } | 985 } |
| 971 http_body.appendData( | 986 http_body.appendData(WebData( |
| 972 WebData(data, params.browser_initiated_post_data.size())); | 987 data, params.request_params.browser_initiated_post_data.size())); |
| 973 request.setHTTPBody(http_body); | 988 request.setHTTPBody(http_body); |
| 974 } | 989 } |
| 975 | 990 |
| 976 // Record this before starting the load, we need a lower bound of this time | 991 // Record this before starting the load, we need a lower bound of this time |
| 977 // to sanitize the navigationStart override set below. | 992 // to sanitize the navigationStart override set below. |
| 978 base::TimeTicks renderer_navigation_start = base::TimeTicks::Now(); | 993 base::TimeTicks renderer_navigation_start = base::TimeTicks::Now(); |
| 979 frame->loadRequest(request); | 994 frame->loadRequest(request); |
| 980 | 995 |
| 981 // The browser provides the navigation_start time to bootstrap the | 996 // The browser provides the navigation_start time to bootstrap the |
| 982 // Navigation Timing information for the browser-initiated navigations. In | 997 // Navigation Timing information for the browser-initiated navigations. In |
| 983 // case of cross-process navigations, this carries over the time of | 998 // case of cross-process navigations, this carries over the time of |
| 984 // finishing the onbeforeunload handler of the previous page. | 999 // finishing the onbeforeunload handler of the previous page. |
| 985 DCHECK(!params.browser_navigation_start.is_null()); | 1000 DCHECK(!params.commit_params.browser_navigation_start.is_null()); |
| 986 if (frame->provisionalDataSource()) { | 1001 if (frame->provisionalDataSource()) { |
| 987 // |browser_navigation_start| is likely before this process existed, so we | 1002 // |browser_navigation_start| is likely before this process existed, so we |
| 988 // can't use InterProcessTimeTicksConverter. We need at least to ensure | 1003 // can't use InterProcessTimeTicksConverter. We need at least to ensure |
| 989 // that the browser-side navigation start we set is not later than the one | 1004 // that the browser-side navigation start we set is not later than the one |
| 990 // on the renderer side. | 1005 // on the renderer side. |
| 991 base::TimeTicks navigation_start = std::min( | 1006 base::TimeTicks navigation_start = |
| 992 params.browser_navigation_start, renderer_navigation_start); | 1007 std::min(params.commit_params.browser_navigation_start, |
| 1008 renderer_navigation_start); | |
| 993 double navigation_start_seconds = | 1009 double navigation_start_seconds = |
| 994 (navigation_start - base::TimeTicks()).InSecondsF(); | 1010 (navigation_start - base::TimeTicks()).InSecondsF(); |
| 995 frame->provisionalDataSource()->setNavigationStartTime( | 1011 frame->provisionalDataSource()->setNavigationStartTime( |
| 996 navigation_start_seconds); | 1012 navigation_start_seconds); |
| 997 } | 1013 } |
| 998 } | 1014 } |
| 999 | 1015 |
| 1000 // In case LoadRequest failed before DidCreateDataSource was called. | 1016 // In case LoadRequest failed before DidCreateDataSource was called. |
| 1001 render_view_->pending_navigation_params_.reset(); | 1017 render_view_->pending_navigation_params_.reset(); |
| 1002 } | 1018 } |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1326 void RenderFrameImpl::OnDisownOpener() { | 1342 void RenderFrameImpl::OnDisownOpener() { |
| 1327 // TODO(creis): We should only see this for main frames for now. To support | 1343 // TODO(creis): We should only see this for main frames for now. To support |
| 1328 // disowning the opener on subframes, we will need to move WebContentsImpl's | 1344 // disowning the opener on subframes, we will need to move WebContentsImpl's |
| 1329 // opener_ to FrameTreeNode. | 1345 // opener_ to FrameTreeNode. |
| 1330 CHECK(!frame_->parent()); | 1346 CHECK(!frame_->parent()); |
| 1331 | 1347 |
| 1332 if (frame_->opener()) | 1348 if (frame_->opener()) |
| 1333 frame_->setOpener(NULL); | 1349 frame_->setOpener(NULL); |
| 1334 } | 1350 } |
| 1335 | 1351 |
| 1352 // PlzNavigate | |
| 1353 void RenderFrameImpl::OnCommitNavigation( | |
| 1354 const GURL& stream_url, | |
| 1355 const CoreNavigationParams& core_params, | |
| 1356 const CommitNavigationParams& commit_params) { | |
| 1357 NOTREACHED(); | |
| 1358 } | |
| 1359 | |
| 1336 #if defined(OS_ANDROID) | 1360 #if defined(OS_ANDROID) |
| 1337 void RenderFrameImpl::OnSelectPopupMenuItems( | 1361 void RenderFrameImpl::OnSelectPopupMenuItems( |
| 1338 bool canceled, | 1362 bool canceled, |
| 1339 const std::vector<int>& selected_indices) { | 1363 const std::vector<int>& selected_indices) { |
| 1340 // It is possible to receive more than one of these calls if the user presses | 1364 // It is possible to receive more than one of these calls if the user presses |
| 1341 // a select faster than it takes for the show-select-popup IPC message to make | 1365 // a select faster than it takes for the show-select-popup IPC message to make |
| 1342 // it to the browser UI thread. Ignore the extra-messages. | 1366 // it to the browser UI thread. Ignore the extra-messages. |
| 1343 // TODO(jcivelli): http:/b/5793321 Implement a better fix, as detailed in bug. | 1367 // TODO(jcivelli): http:/b/5793321 Implement a better fix, as detailed in bug. |
| 1344 if (!external_popup_menu_) | 1368 if (!external_popup_menu_) |
| 1345 return; | 1369 return; |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2129 bool replace = | 2153 bool replace = |
| 2130 navigation_state->pending_page_id() != -1 || | 2154 navigation_state->pending_page_id() != -1 || |
| 2131 PageTransitionCoreTypeIs(navigation_state->transition_type(), | 2155 PageTransitionCoreTypeIs(navigation_state->transition_type(), |
| 2132 PAGE_TRANSITION_AUTO_SUBFRAME); | 2156 PAGE_TRANSITION_AUTO_SUBFRAME); |
| 2133 | 2157 |
| 2134 // If we failed on a browser initiated request, then make sure that our error | 2158 // If we failed on a browser initiated request, then make sure that our error |
| 2135 // page load is regarded as the same browser initiated request. | 2159 // page load is regarded as the same browser initiated request. |
| 2136 if (!navigation_state->is_content_initiated()) { | 2160 if (!navigation_state->is_content_initiated()) { |
| 2137 render_view_->pending_navigation_params_.reset( | 2161 render_view_->pending_navigation_params_.reset( |
| 2138 new FrameMsg_Navigate_Params); | 2162 new FrameMsg_Navigate_Params); |
| 2139 render_view_->pending_navigation_params_->page_id = | 2163 render_view_->pending_navigation_params_->commit_params.page_id = |
| 2140 navigation_state->pending_page_id(); | 2164 navigation_state->pending_page_id(); |
| 2141 render_view_->pending_navigation_params_->pending_history_list_offset = | 2165 render_view_->pending_navigation_params_->commit_params |
| 2166 .pending_history_list_offset = | |
| 2142 navigation_state->pending_history_list_offset(); | 2167 navigation_state->pending_history_list_offset(); |
| 2143 render_view_->pending_navigation_params_->should_clear_history_list = | 2168 render_view_->pending_navigation_params_->commit_params |
| 2169 .should_clear_history_list = | |
| 2144 navigation_state->history_list_was_cleared(); | 2170 navigation_state->history_list_was_cleared(); |
| 2145 render_view_->pending_navigation_params_->transition = | 2171 render_view_->pending_navigation_params_->core_params.transition = |
| 2146 navigation_state->transition_type(); | 2172 navigation_state->transition_type(); |
| 2147 render_view_->pending_navigation_params_->request_time = | 2173 render_view_->pending_navigation_params_->request_time = |
| 2148 document_state->request_time(); | 2174 document_state->request_time(); |
| 2149 render_view_->pending_navigation_params_->should_replace_current_entry = | 2175 render_view_->pending_navigation_params_->should_replace_current_entry = |
| 2150 replace; | 2176 replace; |
| 2151 } | 2177 } |
| 2152 | 2178 |
| 2153 // Load an error page. | 2179 // Load an error page. |
| 2154 LoadNavigationErrorPage(failed_request, error, replace); | 2180 LoadNavigationErrorPage(failed_request, error, replace); |
| 2155 } | 2181 } |
| (...skipping 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3914 | 3940 |
| 3915 #if defined(ENABLE_BROWSER_CDMS) | 3941 #if defined(ENABLE_BROWSER_CDMS) |
| 3916 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3942 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
| 3917 if (!cdm_manager_) | 3943 if (!cdm_manager_) |
| 3918 cdm_manager_ = new RendererCdmManager(this); | 3944 cdm_manager_ = new RendererCdmManager(this); |
| 3919 return cdm_manager_; | 3945 return cdm_manager_; |
| 3920 } | 3946 } |
| 3921 #endif // defined(ENABLE_BROWSER_CDMS) | 3947 #endif // defined(ENABLE_BROWSER_CDMS) |
| 3922 | 3948 |
| 3923 } // namespace content | 3949 } // namespace content |
| OLD | NEW |