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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 974483002: [WebView] Remove onFailure from VisualStateCallback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
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/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 OnDocumentOnLoadCompleted) 353 OnDocumentOnLoadCompleted)
354 IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnload_ACK, OnBeforeUnloadACK) 354 IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnload_ACK, OnBeforeUnloadACK)
355 IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnloadHandlersPresent, 355 IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnloadHandlersPresent,
356 OnBeforeUnloadHandlersPresent) 356 OnBeforeUnloadHandlersPresent)
357 IPC_MESSAGE_HANDLER(FrameHostMsg_UnloadHandlersPresent, 357 IPC_MESSAGE_HANDLER(FrameHostMsg_UnloadHandlersPresent,
358 OnUnloadHandlersPresent) 358 OnUnloadHandlersPresent)
359 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK) 359 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK)
360 IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu) 360 IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu)
361 IPC_MESSAGE_HANDLER(FrameHostMsg_JavaScriptExecuteResponse, 361 IPC_MESSAGE_HANDLER(FrameHostMsg_JavaScriptExecuteResponse,
362 OnJavaScriptExecuteResponse) 362 OnJavaScriptExecuteResponse)
363 IPC_MESSAGE_HANDLER(FrameHostMsg_VisualStateSwapInfo,
364 OnVisualStateSwapInfo)
363 IPC_MESSAGE_HANDLER(FrameHostMsg_VisualStateResponse, 365 IPC_MESSAGE_HANDLER(FrameHostMsg_VisualStateResponse,
364 OnVisualStateResponse) 366 OnVisualStateResponse)
365 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage, 367 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage,
366 OnRunJavaScriptMessage) 368 OnRunJavaScriptMessage)
367 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunBeforeUnloadConfirm, 369 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunBeforeUnloadConfirm,
368 OnRunBeforeUnloadConfirm) 370 OnRunBeforeUnloadConfirm)
369 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAccessInitialDocument, 371 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAccessInitialDocument,
370 OnDidAccessInitialDocument) 372 OnDidAccessInitialDocument)
371 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisownOpener, OnDidDisownOpener) 373 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisownOpener, OnDidDisownOpener)
372 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAssignPageId, OnDidAssignPageId) 374 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAssignPageId, OnDidAssignPageId)
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 std::map<int, JavaScriptResultCallback>::iterator it = 1129 std::map<int, JavaScriptResultCallback>::iterator it =
1128 javascript_callbacks_.find(id); 1130 javascript_callbacks_.find(id);
1129 if (it != javascript_callbacks_.end()) { 1131 if (it != javascript_callbacks_.end()) {
1130 it->second.Run(result_value); 1132 it->second.Run(result_value);
1131 javascript_callbacks_.erase(it); 1133 javascript_callbacks_.erase(it);
1132 } else { 1134 } else {
1133 NOTREACHED() << "Received script response for unknown request"; 1135 NOTREACHED() << "Received script response for unknown request";
1134 } 1136 }
1135 } 1137 }
1136 1138
1139 void RenderFrameHostImpl::OnVisualStateSwapInfo(int source_frame_number,
1140 bool swap_success) {
1141 last_swap_info_ = std::make_pair(source_frame_number, swap_success);
1142 }
1143
1137 void RenderFrameHostImpl::OnVisualStateResponse(uint64 id) { 1144 void RenderFrameHostImpl::OnVisualStateResponse(uint64 id) {
1138 auto it = visual_state_callbacks_.find(id); 1145 auto it = visual_state_callbacks_.find(id);
1139 if (it != visual_state_callbacks_.end()) { 1146 if (it != visual_state_callbacks_.end()) {
1140 it->second.Run(true); 1147 it->second.Run(last_swap_info_.second);
1141 visual_state_callbacks_.erase(it); 1148 visual_state_callbacks_.erase(it);
1142 } else { 1149 } else {
1143 NOTREACHED() << "Received script response for unknown request"; 1150 NOTREACHED() << "Received script response for unknown request";
1144 } 1151 }
1145 } 1152 }
1146 1153
1147 void RenderFrameHostImpl::OnRunJavaScriptMessage( 1154 void RenderFrameHostImpl::OnRunJavaScriptMessage(
1148 const base::string16& message, 1155 const base::string16& message,
1149 const base::string16& default_prompt, 1156 const base::string16& default_prompt,
1150 const GURL& frame_url, 1157 const GURL& frame_url,
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1915 void RenderFrameHostImpl::DidUseGeolocationPermission() { 1922 void RenderFrameHostImpl::DidUseGeolocationPermission() {
1916 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); 1923 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame();
1917 GetContentClient()->browser()->RegisterPermissionUsage( 1924 GetContentClient()->browser()->RegisterPermissionUsage(
1918 PERMISSION_GEOLOCATION, 1925 PERMISSION_GEOLOCATION,
1919 delegate_->GetAsWebContents(), 1926 delegate_->GetAsWebContents(),
1920 GetLastCommittedURL().GetOrigin(), 1927 GetLastCommittedURL().GetOrigin(),
1921 top_frame->GetLastCommittedURL().GetOrigin()); 1928 top_frame->GetLastCommittedURL().GetOrigin());
1922 } 1929 }
1923 1930
1924 } // namespace content 1931 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698