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

Side by Side Diff: Source/core/html/ImageDocument.cpp

Issue 482753002: Use StringBuilder::appendLiteral() / StringBuilder::append(char) when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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/core/frame/FrameConsole.cpp ('k') | Source/core/html/forms/EmailInputType.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) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 static float pageZoomFactor(const Document* document) 101 static float pageZoomFactor(const Document* document)
102 { 102 {
103 LocalFrame* frame = document->frame(); 103 LocalFrame* frame = document->frame();
104 return frame ? frame->pageZoomFactor() : 1; 104 return frame ? frame->pageZoomFactor() : 1;
105 } 105 }
106 106
107 static String imageTitle(const String& filename, const IntSize& size) 107 static String imageTitle(const String& filename, const IntSize& size)
108 { 108 {
109 StringBuilder result; 109 StringBuilder result;
110 result.append(filename); 110 result.append(filename);
111 result.append(" ("); 111 result.appendLiteral(" (");
112 // FIXME: Localize numbers. Safari/OSX shows localized numbers with group 112 // FIXME: Localize numbers. Safari/OSX shows localized numbers with group
113 // separaters. For example, "1,920x1,080". 113 // separaters. For example, "1,920x1,080".
114 result.append(String::number(size.width())); 114 result.append(String::number(size.width()));
115 result.append(static_cast<UChar>(0xD7)); // U+00D7 (multiplication sign) 115 result.append(static_cast<UChar>(0xD7)); // U+00D7 (multiplication sign)
116 result.append(String::number(size.height())); 116 result.append(String::number(size.height()));
117 result.append(')'); 117 result.append(')');
118 return result.toString(); 118 return result.toString();
119 } 119 }
120 120
121 void ImageDocumentParser::appendBytes(const char* data, size_t length) 121 void ImageDocumentParser::appendBytes(const char* data, size_t length)
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 } 393 }
394 394
395 bool ImageEventListener::operator==(const EventListener& listener) 395 bool ImageEventListener::operator==(const EventListener& listener)
396 { 396 {
397 if (const ImageEventListener* imageEventListener = ImageEventListener::cast( &listener)) 397 if (const ImageEventListener* imageEventListener = ImageEventListener::cast( &listener))
398 return m_doc == imageEventListener->m_doc; 398 return m_doc == imageEventListener->m_doc;
399 return false; 399 return false;
400 } 400 }
401 401
402 } 402 }
OLDNEW
« no previous file with comments | « Source/core/frame/FrameConsole.cpp ('k') | Source/core/html/forms/EmailInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698