Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2009 WebLocalFrameImpl* WebLocalFrameImpl::LocalRoot() { | 2009 WebLocalFrameImpl* WebLocalFrameImpl::LocalRoot() { |
| 2010 // This can't use the LocalFrame::localFrameRoot, since it may be called | 2010 // This can't use the LocalFrame::localFrameRoot, since it may be called |
| 2011 // when the WebLocalFrame exists but the core LocalFrame does not. | 2011 // when the WebLocalFrame exists but the core LocalFrame does not. |
| 2012 // TODO(alexmos, dcheng): Clean this up to only calculate this in one place. | 2012 // TODO(alexmos, dcheng): Clean this up to only calculate this in one place. |
| 2013 WebLocalFrameImpl* local_root = this; | 2013 WebLocalFrameImpl* local_root = this; |
| 2014 while (local_root->Parent() && local_root->Parent()->IsWebLocalFrame()) | 2014 while (local_root->Parent() && local_root->Parent()->IsWebLocalFrame()) |
| 2015 local_root = ToWebLocalFrameImpl(local_root->Parent()); | 2015 local_root = ToWebLocalFrameImpl(local_root->Parent()); |
| 2016 return local_root; | 2016 return local_root; |
| 2017 } | 2017 } |
| 2018 | 2018 |
| 2019 WebFrame* WebLocalFrameImpl::FindFrameByName(const WebString& name) { | |
| 2020 Frame* result = GetFrame()->Tree().Find(name); | |
| 2021 return WebFrame::FromFrame(result); | |
|
dcheng
2017/05/26 18:28:05
The original helper on WebView only returned local
Łukasz Anforowicz
2017/05/26 20:04:05
I think these 2 concerns (finding a frame by name
| |
| 2022 } | |
| 2023 | |
| 2019 void WebLocalFrameImpl::SendPings(const WebURL& destination_url) { | 2024 void WebLocalFrameImpl::SendPings(const WebURL& destination_url) { |
| 2020 DCHECK(GetFrame()); | 2025 DCHECK(GetFrame()); |
| 2021 DCHECK(context_menu_node_.Get()); | 2026 DCHECK(context_menu_node_.Get()); |
| 2022 Element* anchor = context_menu_node_->EnclosingLinkEventParentOrSelf(); | 2027 Element* anchor = context_menu_node_->EnclosingLinkEventParentOrSelf(); |
| 2023 if (isHTMLAnchorElement(anchor)) | 2028 if (isHTMLAnchorElement(anchor)) |
| 2024 toHTMLAnchorElement(anchor)->SendPings(destination_url); | 2029 toHTMLAnchorElement(anchor)->SendPings(destination_url); |
| 2025 } | 2030 } |
| 2026 | 2031 |
| 2027 bool WebLocalFrameImpl::DispatchBeforeUnloadEvent(bool is_reload) { | 2032 bool WebLocalFrameImpl::DispatchBeforeUnloadEvent(bool is_reload) { |
| 2028 if (!GetFrame()) | 2033 if (!GetFrame()) |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2582 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { | 2587 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { |
| 2583 return *text_checker_client_; | 2588 return *text_checker_client_; |
| 2584 } | 2589 } |
| 2585 | 2590 |
| 2586 void WebLocalFrameImpl::SetTextCheckClient( | 2591 void WebLocalFrameImpl::SetTextCheckClient( |
| 2587 WebTextCheckClient* text_check_client) { | 2592 WebTextCheckClient* text_check_client) { |
| 2588 text_check_client_ = text_check_client; | 2593 text_check_client_ = text_check_client; |
| 2589 } | 2594 } |
| 2590 | 2595 |
| 2591 } // namespace blink | 2596 } // namespace blink |
| OLD | NEW |