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

Side by Side Diff: Source/core/page/DOMSelection.cpp

Issue 328243004: Change a FrameSelection::setSelectedRange argument type from bool to enum. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 | « Source/core/editing/InputMethodController.cpp ('k') | Source/web/WebLocalFrameImpl.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) 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 if (!isValidForPosition(node)) 208 if (!isValidForPosition(node))
209 return; 209 return;
210 RefPtrWillBeRawPtr<Range> range = Range::create(node->document()); 210 RefPtrWillBeRawPtr<Range> range = Range::create(node->document());
211 range->setStart(node, offset, exceptionState); 211 range->setStart(node, offset, exceptionState);
212 if (exceptionState.hadException()) 212 if (exceptionState.hadException())
213 return; 213 return;
214 range->setEnd(node, offset, exceptionState); 214 range->setEnd(node, offset, exceptionState);
215 if (exceptionState.hadException()) 215 if (exceptionState.hadException())
216 return; 216 return;
217 m_frame->selection().setSelectedRange(range.get(), DOWNSTREAM, m_frame->sele ction().isDirectional()); 217 m_frame->selection().setSelectedRange(range.get(), DOWNSTREAM, m_frame->sele ction().isDirectional() ? FrameSelection::Directional : FrameSelection::NonDirec tional);
218 } 218 }
219 219
220 void DOMSelection::collapse(Node* node, ExceptionState& exceptionState) 220 void DOMSelection::collapse(Node* node, ExceptionState& exceptionState)
221 { 221 {
222 collapse(node, 0, exceptionState); 222 collapse(node, 0, exceptionState);
223 } 223 }
224 224
225 void DOMSelection::collapseToEnd(ExceptionState& exceptionState) 225 void DOMSelection::collapseToEnd(ExceptionState& exceptionState)
226 { 226 {
227 if (!m_frame) 227 if (!m_frame)
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 return node->document() == m_frame->document(); 555 return node->document() == m_frame->document();
556 } 556 }
557 557
558 void DOMSelection::addConsoleError(const String& message) 558 void DOMSelection::addConsoleError(const String& message)
559 { 559 {
560 if (m_treeScope) 560 if (m_treeScope)
561 m_treeScope->document().addConsoleMessage(JSMessageSource, ErrorMessageL evel, message); 561 m_treeScope->document().addConsoleMessage(JSMessageSource, ErrorMessageL evel, message);
562 } 562 }
563 563
564 } // namespace WebCore 564 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/InputMethodController.cpp ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698