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

Side by Side Diff: Source/web/WebRange.cpp

Issue 23671002: Refactoring: Add toWebFrameImpl() interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Corrected as per review commments. Created 7 years, 3 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/web/WebPageSerializerImpl.cpp ('k') | Source/web/WebSharedWorkerImpl.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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 WebRange WebRange::expandedToParagraph() const 109 WebRange WebRange::expandedToParagraph() const
110 { 110 {
111 WebRange copy(*this); 111 WebRange copy(*this);
112 copy.m_private->expand("block", IGNORE_EXCEPTION); 112 copy.m_private->expand("block", IGNORE_EXCEPTION);
113 return copy; 113 return copy;
114 } 114 }
115 115
116 // static 116 // static
117 WebRange WebRange::fromDocumentRange(WebFrame* frame, int start, int length) 117 WebRange WebRange::fromDocumentRange(WebFrame* frame, int start, int length)
118 { 118 {
119 WebCore::Frame* webFrame = static_cast<WebFrameImpl*>(frame)->frame(); 119 WebCore::Frame* webFrame = toWebFrameImpl(frame)->frame();
120 Element* selectionRoot = webFrame->selection()->rootEditableElement(); 120 Element* selectionRoot = webFrame->selection()->rootEditableElement();
121 ContainerNode* scope = selectionRoot ? selectionRoot : webFrame->document()- >documentElement(); 121 ContainerNode* scope = selectionRoot ? selectionRoot : webFrame->document()- >documentElement();
122 return TextIterator::rangeFromLocationAndLength(scope, start, length); 122 return TextIterator::rangeFromLocationAndLength(scope, start, length);
123 } 123 }
124 124
125 WebVector<WebFloatQuad> WebRange::textQuads() const 125 WebVector<WebFloatQuad> WebRange::textQuads() const
126 { 126 {
127 if (isNull()) 127 if (isNull())
128 return WebVector<WebFloatQuad>(); 128 return WebVector<WebFloatQuad>();
129 129
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 void WebRange::assign(WebRangePrivate* p) 162 void WebRange::assign(WebRangePrivate* p)
163 { 163 {
164 // p is already ref'd for us by the caller 164 // p is already ref'd for us by the caller
165 if (m_private) 165 if (m_private)
166 m_private->deref(); 166 m_private->deref();
167 m_private = p; 167 m_private = p;
168 } 168 }
169 169
170 } // namespace WebKit 170 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/WebPageSerializerImpl.cpp ('k') | Source/web/WebSharedWorkerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698