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

Side by Side Diff: third_party/WebKit/Source/core/page/FocusController.cpp

Issue 2012823003: Move IME related functions from WebFrame to WebLocalFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove null check in spellcheck_provider.cc and add some log Created 4 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) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nuanti Ltd. 3 * Copyright (C) 2008 Nuanti Ltd.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 { 790 {
791 if (LocalFrame* frame = focusedFrame()) 791 if (LocalFrame* frame = focusedFrame())
792 return frame; 792 return frame;
793 793
794 // FIXME: This is a temporary hack to ensure that we return a LocalFrame, ev en when the mainFrame is remote. 794 // FIXME: This is a temporary hack to ensure that we return a LocalFrame, ev en when the mainFrame is remote.
795 // FocusController needs to be refactored to deal with RemoteFrames cross-pr ocess focus transfers. 795 // FocusController needs to be refactored to deal with RemoteFrames cross-pr ocess focus transfers.
796 for (Frame* frame = m_page->mainFrame()->tree().top(); frame; frame = frame- >tree().traverseNext()) { 796 for (Frame* frame = m_page->mainFrame()->tree().top(); frame; frame = frame- >tree().traverseNext()) {
797 if (frame->isLocalRoot()) 797 if (frame->isLocalRoot())
798 return frame; 798 return frame;
799 } 799 }
800 800
yabinh 2016/06/22 13:34:50 Sometimes it returns a remote frame. In the build:
801 LOG(ERROR) << "hyb: m_page->mainFrame()->isRemoteFrame() = " << m_page->main Frame()->isRemoteFrame();
801 return m_page->mainFrame(); 802 return m_page->mainFrame();
802 } 803 }
803 804
804 HTMLFrameOwnerElement* FocusController::focusedFrameOwnerElement(LocalFrame& cur rentFrame) const 805 HTMLFrameOwnerElement* FocusController::focusedFrameOwnerElement(LocalFrame& cur rentFrame) const
805 { 806 {
806 Frame* focusedFrame = m_focusedFrame.get(); 807 Frame* focusedFrame = m_focusedFrame.get();
807 for (; focusedFrame; focusedFrame = focusedFrame->tree().parent()) { 808 for (; focusedFrame; focusedFrame = focusedFrame->tree().parent()) {
808 if (focusedFrame->tree().parent() == &currentFrame) { 809 if (focusedFrame->tree().parent() == &currentFrame) {
809 DCHECK(focusedFrame->owner()->isLocal()); 810 DCHECK(focusedFrame->owner()->isLocal());
810 return focusedFrame->deprecatedLocalOwner(); 811 return focusedFrame->deprecatedLocalOwner();
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 return consumed; 1309 return consumed;
1309 } 1310 }
1310 1311
1311 DEFINE_TRACE(FocusController) 1312 DEFINE_TRACE(FocusController)
1312 { 1313 {
1313 visitor->trace(m_page); 1314 visitor->trace(m_page);
1314 visitor->trace(m_focusedFrame); 1315 visitor->trace(m_focusedFrame);
1315 } 1316 }
1316 1317
1317 } // namespace blink 1318 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698