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

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

Issue 2374183004: Make non-null VisibleSelections creatable only by createVisibleSelection[Deprecated] (Closed)
Patch Set: Fix mac compile error Created 4 years, 2 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 // no caret and does respond to keyboard inputs. 457 // no caret and does respond to keyboard inputs.
458 focusedFrame->document()->updateStyleAndLayoutTree(); 458 focusedFrame->document()->updateStyleAndLayoutTree();
459 if (element->isTextFormControl()) { 459 if (element->isTextFormControl()) {
460 element->updateFocusAppearance(SelectionBehaviorOnFocus::Res tore); 460 element->updateFocusAppearance(SelectionBehaviorOnFocus::Res tore);
461 } else if (hasEditableStyle(*element)) { 461 } else if (hasEditableStyle(*element)) {
462 // updateFocusAppearance() selects all the text of 462 // updateFocusAppearance() selects all the text of
463 // contentseditable DIVs. So we set the selection explicitly 463 // contentseditable DIVs. So we set the selection explicitly
464 // instead. Note that this has the side effect of moving the 464 // instead. Note that this has the side effect of moving the
465 // caret back to the beginning of the text. 465 // caret back to the beginning of the text.
466 Position position(element, 0); 466 Position position(element, 0);
467 focusedFrame->selection().setSelection(VisibleSelection(posi tion, SelDefaultAffinity)); 467 focusedFrame->selection().setSelection(createVisibleSelectio nDeprecated(position, SelDefaultAffinity));
468 } 468 }
469 } 469 }
470 } 470 }
471 } else { 471 } else {
472 LocalFrame* focusedFrame = focusedLocalFrameInWidget(); 472 LocalFrame* focusedFrame = focusedLocalFrameInWidget();
473 if (focusedFrame) { 473 if (focusedFrame) {
474 // Finish an ongoing composition to delete the composition node. 474 // Finish an ongoing composition to delete the composition node.
475 if (focusedFrame->inputMethodController().hasComposition()) { 475 if (focusedFrame->inputMethodController().hasComposition()) {
476 WebAutofillClient* autofillClient = WebLocalFrameImpl::fromFrame (focusedFrame)->autofillClient(); 476 WebAutofillClient* autofillClient = WebLocalFrameImpl::fromFrame (focusedFrame)->autofillClient();
477 477
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 } 1505 }
1506 1506
1507 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const 1507 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const
1508 { 1508 {
1509 if (!m_imeAcceptEvents) 1509 if (!m_imeAcceptEvents)
1510 return nullptr; 1510 return nullptr;
1511 return focusedLocalFrameInWidget(); 1511 return focusedLocalFrameInWidget();
1512 } 1512 }
1513 1513
1514 } // namespace blink 1514 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698