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

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

Issue 100303003: Move more uses of string16 to specify base:: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « ui/events/keycodes/keyboard_code_conversion_x.cc ('k') | ui/gfx/render_text.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/pango_util.h" 5 #include "ui/gfx/pango_util.h"
6 6
7 #include <cairo/cairo.h> 7 #include <cairo/cairo.h>
8 #include <fontconfig/fontconfig.h> 8 #include <fontconfig/fontconfig.h>
9 #include <pango/pango.h> 9 #include <pango/pango.h>
10 #include <pango/pangocairo.h> 10 #include <pango/pangocairo.h>
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 kAcceleratorChar, NULL); 219 kAcceleratorChar, NULL);
220 g_free(escaped_text); 220 g_free(escaped_text);
221 } else { 221 } else {
222 std::string utf8; 222 std::string utf8;
223 223
224 // Remove the ampersand character. A double ampersand is output as 224 // Remove the ampersand character. A double ampersand is output as
225 // a single ampersand. 225 // a single ampersand.
226 if (flags & Canvas::HIDE_PREFIX) { 226 if (flags & Canvas::HIDE_PREFIX) {
227 DCHECK_EQ(1, g_unichar_to_utf8(kAcceleratorChar, NULL)); 227 DCHECK_EQ(1, g_unichar_to_utf8(kAcceleratorChar, NULL));
228 base::string16 accelerator_removed = 228 base::string16 accelerator_removed =
229 RemoveAcceleratorChar(text, static_cast<char16>(kAcceleratorChar), 229 RemoveAcceleratorChar(text,
230 static_cast<base::char16>(kAcceleratorChar),
230 NULL, NULL); 231 NULL, NULL);
231 utf8 = UTF16ToUTF8(accelerator_removed); 232 utf8 = UTF16ToUTF8(accelerator_removed);
232 } else { 233 } else {
233 utf8 = UTF16ToUTF8(text); 234 utf8 = UTF16ToUTF8(text);
234 } 235 }
235 236
236 pango_layout_set_text(layout, utf8.data(), utf8.size()); 237 pango_layout_set_text(layout, utf8.data(), utf8.size());
237 } 238 }
238 } 239 }
239 240
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 295
295 if (i == desc_to_metrics->end()) { 296 if (i == desc_to_metrics->end()) {
296 PangoFontMetrics* metrics = pango_context_get_metrics(context, desc, NULL); 297 PangoFontMetrics* metrics = pango_context_get_metrics(context, desc, NULL);
297 desc_to_metrics->insert(std::make_pair(desc_hash, metrics)); 298 desc_to_metrics->insert(std::make_pair(desc_hash, metrics));
298 return metrics; 299 return metrics;
299 } 300 }
300 return i->second; 301 return i->second;
301 } 302 }
302 303
303 } // namespace gfx 304 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/events/keycodes/keyboard_code_conversion_x.cc ('k') | ui/gfx/render_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698