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

Side by Side Diff: Source/web/mac/WebSubstringUtil.mm

Issue 398673003: Rename WebCore namespace to blink in bindings and web (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/mac/WebScrollbarTheme.mm ('k') | Source/web/painting/ContinuousPainter.h » ('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) 2005, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "core/rendering/style/RenderStyle.h" 50 #include "core/rendering/style/RenderStyle.h"
51 #include "platform/fonts/Font.h" 51 #include "platform/fonts/Font.h"
52 #include "platform/mac/ColorMac.h" 52 #include "platform/mac/ColorMac.h"
53 #include "public/platform/WebRect.h" 53 #include "public/platform/WebRect.h"
54 #include "public/web/WebHitTestResult.h" 54 #include "public/web/WebHitTestResult.h"
55 #include "public/web/WebRange.h" 55 #include "public/web/WebRange.h"
56 #include "public/web/WebView.h" 56 #include "public/web/WebView.h"
57 #include "web/WebLocalFrameImpl.h" 57 #include "web/WebLocalFrameImpl.h"
58 #include "web/WebViewImpl.h" 58 #include "web/WebViewImpl.h"
59 59
60 using namespace WebCore; 60 using namespace blink;
61 61
62 static NSAttributedString* attributedSubstringFromRange(const Range* range) 62 static NSAttributedString* attributedSubstringFromRange(const Range* range)
63 { 63 {
64 NSMutableAttributedString* string = [[NSMutableAttributedString alloc] init] ; 64 NSMutableAttributedString* string = [[NSMutableAttributedString alloc] init] ;
65 NSMutableDictionary* attrs = [NSMutableDictionary dictionary]; 65 NSMutableDictionary* attrs = [NSMutableDictionary dictionary];
66 size_t length = range->endOffset() - range->startOffset(); 66 size_t length = range->endOffset() - range->startOffset();
67 67
68 unsigned position = 0; 68 unsigned position = 0;
69 for (TextIterator it(range); !it.atEnd() && [string length] < length; it.adv ance()) { 69 for (TextIterator it(range); !it.atEnd() && [string length] < length; it.adv ance()) {
70 unsigned numCharacters = it.length(); 70 unsigned numCharacters = it.length();
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 Element* editable = frame->selection().rootEditableElementOrDocumentElement( ); 157 Element* editable = frame->selection().rootEditableElementOrDocumentElement( );
158 ASSERT(editable); 158 ASSERT(editable);
159 RefPtrWillBeRawPtr<Range> range(PlainTextRange(location, location + length). createRange(*editable)); 159 RefPtrWillBeRawPtr<Range> range(PlainTextRange(location, location + length). createRange(*editable));
160 if (!range) 160 if (!range)
161 return nil; 161 return nil;
162 162
163 return attributedSubstringFromRange(range.get()); 163 return attributedSubstringFromRange(range.get());
164 } 164 }
165 165
166 } // namespace blink 166 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/mac/WebScrollbarTheme.mm ('k') | Source/web/painting/ContinuousPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698