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

Side by Side Diff: chrome/common/gfx/text_elider.cc

Issue 40226: Fix files with lines > 80 cols. Part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 9 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 | « chrome/common/gfx/color_utils.cc ('k') | chrome/common/l10n_util.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/string_util.h" 6 #include "base/string_util.h"
7 #include "chrome/common/gfx/chrome_font.h" 7 #include "chrome/common/gfx/chrome_font.h"
8 #include "chrome/common/gfx/text_elider.h" 8 #include "chrome/common/gfx/text_elider.h"
9 #include "chrome/common/pref_names.h" 9 #include "chrome/common/pref_names.h"
10 #include "chrome/common/pref_service.h" 10 #include "chrome/common/pref_service.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 } 369 }
370 370
371 void AppendFormattedComponent(const std::string& spec, 371 void AppendFormattedComponent(const std::string& spec,
372 const url_parse::Component& in_component, 372 const url_parse::Component& in_component,
373 std::wstring* output, 373 std::wstring* output,
374 url_parse::Component* out_component) { 374 url_parse::Component* out_component) {
375 if (in_component.is_nonempty()) { 375 if (in_component.is_nonempty()) {
376 out_component->begin = static_cast<int>(output->length()); 376 out_component->begin = static_cast<int>(output->length());
377 377
378 output->append(UnescapeAndDecodeUTF8URLComponent( 378 output->append(UnescapeAndDecodeUTF8URLComponent(
379 spec.substr(in_component.begin, in_component.len), UnescapeRule::NORMAL) ); 379 spec.substr(in_component.begin, in_component.len),
380 UnescapeRule::NORMAL));
380 381
381 out_component->len = 382 out_component->len =
382 static_cast<int>(output->length()) - out_component->begin; 383 static_cast<int>(output->length()) - out_component->begin;
383 } else { 384 } else {
384 out_component->reset(); 385 out_component->reset();
385 } 386 }
386 } 387 }
387 388
388 std::wstring GetCleanStringFromUrl(const GURL& url, 389 std::wstring GetCleanStringFromUrl(const GURL& url,
389 const std::wstring& languages, 390 const std::wstring& languages,
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 string16 SortedDisplayURL::AfterHost() const { 509 string16 SortedDisplayURL::AfterHost() const {
509 size_t slash_index = display_url_.find(sort_host_, prefix_end_); 510 size_t slash_index = display_url_.find(sort_host_, prefix_end_);
510 if (slash_index == string16::npos) { 511 if (slash_index == string16::npos) {
511 NOTREACHED(); 512 NOTREACHED();
512 return string16(); 513 return string16();
513 } 514 }
514 return display_url_.substr(slash_index + sort_host_.length()); 515 return display_url_.substr(slash_index + sort_host_.length());
515 } 516 }
516 517
517 } // namespace gfx. 518 } // namespace gfx.
OLDNEW
« no previous file with comments | « chrome/common/gfx/color_utils.cc ('k') | chrome/common/l10n_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698