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

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

Issue 1433103002: Use FocusParams in FocusController::setFocusedElement and Document::setFocusedElement arguments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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) 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 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 while (target) { 1090 while (target) {
1091 // We don't want to set focus on a subframe when selecting in a pare nt frame, 1091 // We don't want to set focus on a subframe when selecting in a pare nt frame,
1092 // so add the !isFrameElement check here. There's probably a better way to make this 1092 // so add the !isFrameElement check here. There's probably a better way to make this
1093 // work in the long term, but this is the safest fix at this time. 1093 // work in the long term, but this is the safest fix at this time.
1094 if (target->isMouseFocusable() && !isFrameElement(target)) { 1094 if (target->isMouseFocusable() && !isFrameElement(target)) {
1095 m_frame->page()->focusController().setFocusedElement(target, m_f rame); 1095 m_frame->page()->focusController().setFocusedElement(target, m_f rame);
1096 return; 1096 return;
1097 } 1097 }
1098 target = target->parentOrShadowHostElement(); 1098 target = target->parentOrShadowHostElement();
1099 } 1099 }
1100 m_frame->document()->setFocusedElement(nullptr); 1100 m_frame->document()->clearFocusedElement();
1101 } 1101 }
1102 1102
1103 if (caretBrowsing) 1103 if (caretBrowsing)
1104 m_frame->page()->focusController().setFocusedElement(0, m_frame); 1104 m_frame->page()->focusController().setFocusedElement(0, m_frame);
1105 } 1105 }
1106 1106
1107 template <typename Strategy> 1107 template <typename Strategy>
1108 String extractSelectedTextAlgorithm(const FrameSelection& selection, TextIterato rBehavior behavior) 1108 String extractSelectedTextAlgorithm(const FrameSelection& selection, TextIterato rBehavior behavior)
1109 { 1109 {
1110 const VisibleSelectionTemplate<Strategy> visibleSelection = selection.visibl eSelection<Strategy>(); 1110 const VisibleSelectionTemplate<Strategy> visibleSelection = selection.visibl eSelection<Strategy>();
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 1401
1402 void showTree(const blink::FrameSelection* sel) 1402 void showTree(const blink::FrameSelection* sel)
1403 { 1403 {
1404 if (sel) 1404 if (sel)
1405 sel->showTreeForThis(); 1405 sel->showTreeForThis();
1406 else 1406 else
1407 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); 1407 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n");
1408 } 1408 }
1409 1409
1410 #endif 1410 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698