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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2907663004: FrameTree::Find only searches relative to local frames. (Closed)
Patch Set: Rebasing... Created 3 years, 6 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 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 2612 matching lines...) Expand 10 before | Expand all | Expand 10 after
2623 if (!page_->DeprecatedLocalMainFrame()->GetDocument()->Loader()) 2623 if (!page_->DeprecatedLocalMainFrame()->GetDocument()->Loader())
2624 return WebString(); 2624 return WebString();
2625 2625
2626 return page_->DeprecatedLocalMainFrame()->GetDocument()->EncodingName(); 2626 return page_->DeprecatedLocalMainFrame()->GetDocument()->EncodingName();
2627 } 2627 }
2628 2628
2629 WebFrame* WebViewImpl::MainFrame() { 2629 WebFrame* WebViewImpl::MainFrame() {
2630 return WebFrame::FromFrame(page_ ? page_->MainFrame() : nullptr); 2630 return WebFrame::FromFrame(page_ ? page_->MainFrame() : nullptr);
2631 } 2631 }
2632 2632
2633 WebFrame* WebViewImpl::FindFrameByName(const WebString& name,
2634 WebFrame* relative_to_frame) {
2635 // FIXME: Either this should only deal with WebLocalFrames or it should move
2636 // to WebFrame.
2637 if (!relative_to_frame)
2638 relative_to_frame = MainFrame();
2639 Frame* frame = ToWebLocalFrameBase(relative_to_frame)->GetFrame();
2640 frame = frame->Tree().Find(name);
2641 if (!frame || !frame->IsLocalFrame())
2642 return nullptr;
2643 return WebLocalFrameBase::FromFrame(ToLocalFrame(frame));
2644 }
2645
2646 WebLocalFrame* WebViewImpl::FocusedFrame() { 2633 WebLocalFrame* WebViewImpl::FocusedFrame() {
2647 Frame* frame = FocusedCoreFrame(); 2634 Frame* frame = FocusedCoreFrame();
2648 // TODO(yabinh): focusedCoreFrame() should always return a local frame, and 2635 // TODO(yabinh): focusedCoreFrame() should always return a local frame, and
2649 // the following check should be unnecessary. 2636 // the following check should be unnecessary.
2650 // See crbug.com/625068 2637 // See crbug.com/625068
2651 if (!frame || !frame->IsLocalFrame()) 2638 if (!frame || !frame->IsLocalFrame())
2652 return nullptr; 2639 return nullptr;
2653 return WebLocalFrameBase::FromFrame(ToLocalFrame(frame)); 2640 return WebLocalFrameBase::FromFrame(ToLocalFrame(frame));
2654 } 2641 }
2655 2642
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
4148 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) 4135 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame())
4149 return nullptr; 4136 return nullptr;
4150 return focused_frame; 4137 return focused_frame;
4151 } 4138 }
4152 4139
4153 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { 4140 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const {
4154 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; 4141 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr;
4155 } 4142 }
4156 4143
4157 } // namespace blink 4144 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698