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

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

Issue 1233453011: Revert of Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « ui/gfx/font_list.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_list_impl.h" 5 #include "ui/gfx/font_list_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 26 matching lines...) Expand all
37 namespace gfx { 37 namespace gfx {
38 38
39 FontListImpl::FontListImpl(const std::string& font_description_string) 39 FontListImpl::FontListImpl(const std::string& font_description_string)
40 : font_description_string_(font_description_string), 40 : font_description_string_(font_description_string),
41 common_height_(-1), 41 common_height_(-1),
42 common_baseline_(-1), 42 common_baseline_(-1),
43 font_style_(-1), 43 font_style_(-1),
44 font_size_(-1) { 44 font_size_(-1) {
45 DCHECK(!font_description_string.empty()); 45 DCHECK(!font_description_string.empty());
46 // DCHECK description string ends with "px" for size in pixel. 46 // DCHECK description string ends with "px" for size in pixel.
47 DCHECK(base::EndsWith(font_description_string, "px", 47 DCHECK(base::EndsWith(font_description_string, "px", true));
48 base::CompareCase::SENSITIVE));
49 } 48 }
50 49
51 FontListImpl::FontListImpl(const std::vector<std::string>& font_names, 50 FontListImpl::FontListImpl(const std::vector<std::string>& font_names,
52 int font_style, 51 int font_style,
53 int font_size) 52 int font_size)
54 : font_description_string_(BuildDescription(font_names, font_style, 53 : font_description_string_(BuildDescription(font_names, font_style,
55 font_size)), 54 font_size)),
56 common_height_(-1), 55 common_height_(-1),
57 common_baseline_(-1), 56 common_baseline_(-1),
58 font_style_(font_style), 57 font_style_(font_style),
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 font_style_ = fonts_[0].GetStyle(); 189 font_style_ = fonts_[0].GetStyle();
191 font_size_ = fonts_[0].GetFontSize(); 190 font_size_ = fonts_[0].GetFontSize();
192 } else { 191 } else {
193 std::vector<std::string> font_names; 192 std::vector<std::string> font_names;
194 CHECK(FontList::ParseDescription(font_description_string_, &font_names, 193 CHECK(FontList::ParseDescription(font_description_string_, &font_names,
195 &font_style_, &font_size_)); 194 &font_style_, &font_size_));
196 } 195 }
197 } 196 }
198 197
199 } // namespace gfx 198 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/font_list.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698