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

Side by Side Diff: ui/gfx/font_fallback_win.cc

Issue 16051006: ui/gfx: Use base::string16 now that string16 was moved into base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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 | « ui/gfx/font.cc ('k') | ui/gfx/font_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/font_fallback_win.h" 5 #include "ui/gfx/font_fallback_win.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 30 matching lines...) Expand all
41 std::map<std::string, std::string>::const_iterator it = 41 std::map<std::string, std::string>::const_iterator it =
42 font_map->find(StringToLowerASCII(filename)); 42 font_map->find(StringToLowerASCII(filename));
43 if (it == font_map->end()) 43 if (it == font_map->end())
44 return; 44 return;
45 45
46 internal::ParseFontFamilyString(it->second, font_names); 46 internal::ParseFontFamilyString(it->second, font_names);
47 } 47 }
48 48
49 // Returns true if |text| contains only ASCII digits. 49 // Returns true if |text| contains only ASCII digits.
50 bool ContainsOnlyDigits(const std::string& text) { 50 bool ContainsOnlyDigits(const std::string& text) {
51 return text.find_first_not_of("0123456789") == string16::npos; 51 return text.find_first_not_of("0123456789") == base::string16::npos;
52 } 52 }
53 53
54 // Appends a Font with the given |name| and |size| to |fonts| unless the last 54 // Appends a Font with the given |name| and |size| to |fonts| unless the last
55 // entry is already a font with that name. 55 // entry is already a font with that name.
56 void AppendFont(const std::string& name, int size, std::vector<Font>* fonts) { 56 void AppendFont(const std::string& name, int size, std::vector<Font>* fonts) {
57 if (fonts->empty() || fonts->back().GetFontName() != name) 57 if (fonts->empty() || fonts->back().GetFontName() != name)
58 fonts->push_back(Font(name, size)); 58 fonts->push_back(Font(name, size));
59 } 59 }
60 60
61 // Queries the registry to get a list of linked fonts for |font|. 61 // Queries the registry to get a list of linked fonts for |font|.
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // Note: One possibility would be to always merge both lists of fonts, 234 // Note: One possibility would be to always merge both lists of fonts,
235 // but it is not clear whether there are any real world scenarios 235 // but it is not clear whether there are any real world scenarios
236 // where this would actually help. 236 // where this would actually help.
237 if (fonts->empty()) 237 if (fonts->empty())
238 fonts = font_link->GetLinkedFonts(current_font_); 238 fonts = font_link->GetLinkedFonts(current_font_);
239 239
240 return fonts; 240 return fonts;
241 } 241 }
242 242
243 } // namespace gfx 243 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/font.cc ('k') | ui/gfx/font_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698