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

Side by Side Diff: chrome/browser/ui/cocoa/l10n_util.mm

Issue 1227413007: Move ReplaceStringPlaceholders to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@join
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 | « chrome/browser/ui/cocoa/l10n_util.h ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #import "chrome/browser/ui/cocoa/l10n_util.h" 5 #import "chrome/browser/ui/cocoa/l10n_util.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTw eaker.h" 9 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTw eaker.h"
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 origin.y -= localVerticalShift; 62 origin.y -= localVerticalShift;
63 [view setFrameOrigin:origin]; 63 [view setFrameOrigin:origin];
64 } 64 }
65 } 65 }
66 return localVerticalShift; 66 return localVerticalShift;
67 } 67 }
68 68
69 NSString* ReplaceNSStringPlaceholders(NSString* formatString, 69 NSString* ReplaceNSStringPlaceholders(NSString* formatString,
70 const base::string16& a, 70 const base::string16& a,
71 size_t* offset) { 71 size_t* offset) {
72 return base::SysUTF16ToNSString( 72 return base::SysUTF16ToNSString(base::ReplaceStringPlaceholders(
73 ReplaceStringPlaceholders(base::SysNSStringToUTF16(formatString), 73 base::SysNSStringToUTF16(formatString), a, offset));
74 a,
75 offset));
76 } 74 }
77 75
78 NSString* TooltipForURLAndTitle(NSString* url, NSString* title) { 76 NSString* TooltipForURLAndTitle(NSString* url, NSString* title) {
79 if ([title length] == 0) 77 if ([title length] == 0)
80 return url; 78 return url;
81 else if ([url length] == 0 || [url isEqualToString:title]) 79 else if ([url length] == 0 || [url isEqualToString:title])
82 return title; 80 return title;
83 else 81 else
84 return [NSString stringWithFormat:@"%@\n%@", title, url]; 82 return [NSString stringWithFormat:@"%@\n%@", title, url];
85 } 83 }
86 84
87 } // namespace cocoa_l10n_util 85 } // namespace cocoa_l10n_util
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/l10n_util.h ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698