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

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

Issue 2442673002: Get rid of createVisibleSelection() taking one Position (Closed)
Patch Set: 2016-10-24T17:42:38 Created 4 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
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | no next file » | 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) 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 2360 matching lines...) Expand 10 before | Expand all | Expand 10 after
2371 focusedFrame->document()->updateStyleAndLayoutTree(); 2371 focusedFrame->document()->updateStyleAndLayoutTree();
2372 if (element->isTextFormControl()) { 2372 if (element->isTextFormControl()) {
2373 element->updateFocusAppearance(SelectionBehaviorOnFocus::Restore); 2373 element->updateFocusAppearance(SelectionBehaviorOnFocus::Restore);
2374 } else if (hasEditableStyle(*element)) { 2374 } else if (hasEditableStyle(*element)) {
2375 // updateFocusAppearance() selects all the text of 2375 // updateFocusAppearance() selects all the text of
2376 // contentseditable DIVs. So we set the selection explicitly 2376 // contentseditable DIVs. So we set the selection explicitly
2377 // instead. Note that this has the side effect of moving the 2377 // instead. Note that this has the side effect of moving the
2378 // caret back to the beginning of the text. 2378 // caret back to the beginning of the text.
2379 Position position(element, 0); 2379 Position position(element, 0);
2380 focusedFrame->selection().setSelection( 2380 focusedFrame->selection().setSelection(
2381 createVisibleSelection(position, SelDefaultAffinity)); 2381 SelectionInDOMTree::Builder().collapse(position).build());
2382 } 2382 }
2383 } 2383 }
2384 } 2384 }
2385 m_imeAcceptEvents = true; 2385 m_imeAcceptEvents = true;
2386 } else { 2386 } else {
2387 hidePopups(); 2387 hidePopups();
2388 2388
2389 // Clear focus on the currently focused frame if any. 2389 // Clear focus on the currently focused frame if any.
2390 if (!m_page) 2390 if (!m_page)
2391 return; 2391 return;
(...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after
4551 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4551 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4552 return nullptr; 4552 return nullptr;
4553 return focusedFrame; 4553 return focusedFrame;
4554 } 4554 }
4555 4555
4556 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4556 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4557 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4557 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4558 } 4558 }
4559 4559
4560 } // namespace blink 4560 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698