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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.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) 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 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2264 // no caret and does respond to keyboard inputs. 2264 // no caret and does respond to keyboard inputs.
2265 focusedFrame->document()->updateStyleAndLayoutTree(); 2265 focusedFrame->document()->updateStyleAndLayoutTree();
2266 if (element->isTextFormControl()) { 2266 if (element->isTextFormControl()) {
2267 element->updateFocusAppearance(SelectionBehaviorOnFocus::Res tore); 2267 element->updateFocusAppearance(SelectionBehaviorOnFocus::Res tore);
2268 } else if (hasEditableStyle(*element)) { 2268 } else if (hasEditableStyle(*element)) {
2269 // updateFocusAppearance() selects all the text of 2269 // updateFocusAppearance() selects all the text of
2270 // contentseditable DIVs. So we set the selection explicitly 2270 // contentseditable DIVs. So we set the selection explicitly
2271 // instead. Note that this has the side effect of moving the 2271 // instead. Note that this has the side effect of moving the
2272 // caret back to the beginning of the text. 2272 // caret back to the beginning of the text.
2273 Position position(element, 0); 2273 Position position(element, 0);
2274 focusedFrame->selection().setSelection(VisibleSelection(posi tion, SelDefaultAffinity)); 2274 focusedFrame->selection().setSelection(createVisibleSelectio nDeprecated(position, SelDefaultAffinity));
2275 } 2275 }
2276 } 2276 }
2277 } 2277 }
2278 m_imeAcceptEvents = true; 2278 m_imeAcceptEvents = true;
2279 } else { 2279 } else {
2280 hidePopups(); 2280 hidePopups();
2281 2281
2282 // Clear focus on the currently focused frame if any. 2282 // Clear focus on the currently focused frame if any.
2283 if (!m_page) 2283 if (!m_page)
2284 return; 2284 return;
(...skipping 2307 matching lines...) Expand 10 before | Expand all | Expand 10 after
4592 return nullptr; 4592 return nullptr;
4593 return focusedFrame; 4593 return focusedFrame;
4594 } 4594 }
4595 4595
4596 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const 4596 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const
4597 { 4597 {
4598 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4598 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4599 } 4599 }
4600 4600
4601 } // namespace blink 4601 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698