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/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 Loading... | |
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(); | |
321 } | |
322 return frame_tree_node_->current_replication_state().origin; | |
alexmos
2015/11/24 18:23:48
Nit: s/current_replication_state().origin/current_
ncarter (slow)
2015/11/24 19:35:08
Done.
| |
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 Loading... | |
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 |
OLD | NEW |