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

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

Issue 1475433002: Expose RenderFrameHost::GetLastCommittedOrigin(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Alexmos's fixes. Created 5 years 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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 if (!parent_node) 306 if (!parent_node)
307 return false; 307 return false;
308 return GetSiteInstance() != 308 return GetSiteInstance() !=
309 parent_node->current_frame_host()->GetSiteInstance(); 309 parent_node->current_frame_host()->GetSiteInstance();
310 } 310 }
311 311
312 GURL RenderFrameHostImpl::GetLastCommittedURL() { 312 GURL RenderFrameHostImpl::GetLastCommittedURL() {
313 return frame_tree_node_->current_url(); 313 return frame_tree_node_->current_url();
314 } 314 }
315 315
316 url::Origin RenderFrameHostImpl::GetLastCommittedOrigin() {
317 // Origin is stored per-FTN, so it's incorrect to call for a non-current RFH.
318 if (this != frame_tree_node_->current_frame_host()) {
319 NOTREACHED() << "Origin information is tracked only for the current host.";
320 return url::Origin();
Charlie Reis 2015/11/24 21:00:42 Sanity check: Since there aren't callers yet, do w
ncarter (slow) 2015/11/24 22:07:33 Switched to a CHECK based on our face-to-face disc
321 }
322 return frame_tree_node_->current_origin();
323 }
324
316 gfx::NativeView RenderFrameHostImpl::GetNativeView() { 325 gfx::NativeView RenderFrameHostImpl::GetNativeView() {
317 RenderWidgetHostView* view = render_view_host_->GetWidget()->GetView(); 326 RenderWidgetHostView* view = render_view_host_->GetWidget()->GetView();
318 if (!view) 327 if (!view)
319 return NULL; 328 return NULL;
320 return view->GetNativeView(); 329 return view->GetNativeView();
321 } 330 }
322 331
323 void RenderFrameHostImpl::AddMessageToConsole(ConsoleMessageLevel level, 332 void RenderFrameHostImpl::AddMessageToConsole(ConsoleMessageLevel level,
324 const std::string& message) { 333 const std::string& message) {
325 Send(new FrameMsg_AddMessageToConsole(routing_id_, level, message)); 334 Send(new FrameMsg_AddMessageToConsole(routing_id_, level, message));
(...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after
2374 *dst = src; 2383 *dst = src;
2375 2384
2376 if (src.routing_id != -1) 2385 if (src.routing_id != -1)
2377 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); 2386 dst->tree_id = RoutingIDToAXTreeID(src.routing_id);
2378 2387
2379 if (src.parent_routing_id != -1) 2388 if (src.parent_routing_id != -1)
2380 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); 2389 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id);
2381 } 2390 }
2382 2391
2383 } // namespace content 2392 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698