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

Side by Side Diff: third_party/WebKit/Source/core/editing/FrameSelection.cpp

Issue 2810873007: Replace LayoutPart::GetFrameViewBase with GetNodeFrameView (Closed)
Patch Set: No need for child_frame_view var Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 } 792 }
793 793
794 // Helper function that tells whether a particular node is an element that has 794 // Helper function that tells whether a particular node is an element that has
795 // an entire LocalFrame and FrameView, a <frame>, <iframe>, or <object>. 795 // an entire LocalFrame and FrameView, a <frame>, <iframe>, or <object>.
796 static bool IsFrameElement(const Node* n) { 796 static bool IsFrameElement(const Node* n) {
797 if (!n) 797 if (!n)
798 return false; 798 return false;
799 LayoutObject* layout_object = n->GetLayoutObject(); 799 LayoutObject* layout_object = n->GetLayoutObject();
800 if (!layout_object || !layout_object->IsLayoutPart()) 800 if (!layout_object || !layout_object->IsLayoutPart())
801 return false; 801 return false;
802 FrameViewBase* frame_view_base = 802 return ToLayoutPart(layout_object)->ChildFrameView();
803 ToLayoutPart(layout_object)->GetFrameViewBase();
804 return frame_view_base && frame_view_base->IsFrameView();
805 } 803 }
806 804
807 void FrameSelection::SetFocusedNodeIfNeeded() { 805 void FrameSelection::SetFocusedNodeIfNeeded() {
808 if (ComputeVisibleSelectionInDOMTreeDeprecated().IsNone() || !IsFocused()) 806 if (ComputeVisibleSelectionInDOMTreeDeprecated().IsNone() || !IsFocused())
809 return; 807 return;
810 808
811 if (Element* target = 809 if (Element* target =
812 ComputeVisibleSelectionInDOMTreeDeprecated().RootEditableElement()) { 810 ComputeVisibleSelectionInDOMTreeDeprecated().RootEditableElement()) {
813 // Walk up the DOM tree to search for a node to focus. 811 // Walk up the DOM tree to search for a node to focus.
814 GetDocument().UpdateStyleAndLayoutTreeIgnorePendingStylesheets(); 812 GetDocument().UpdateStyleAndLayoutTreeIgnorePendingStylesheets();
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 } 1160 }
1163 1161
1164 void showTree(const blink::FrameSelection* sel) { 1162 void showTree(const blink::FrameSelection* sel) {
1165 if (sel) 1163 if (sel)
1166 sel->ShowTreeForThis(); 1164 sel->ShowTreeForThis();
1167 else 1165 else
1168 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1166 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1169 } 1167 }
1170 1168
1171 #endif 1169 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698