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

Side by Side Diff: ui/message_center/cocoa/notification_controller.mm

Issue 1237873004: Revert of Move JoinString to the base namespace (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/gl/gl_implementation.cc ('k') | ui/message_center/views/bounded_label.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/message_center/cocoa/notification_controller.h" 5 #import "ui/message_center/cocoa/notification_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 // too wide, that line will be further elided by the gfx::ElideText below. 876 // too wide, that line will be further elided by the gfx::ElideText below.
877 base::string16 last = 877 base::string16 last =
878 wrapped[lines - 1] + base::UTF8ToUTF16(gfx::kEllipsis); 878 wrapped[lines - 1] + base::UTF8ToUTF16(gfx::kEllipsis);
879 if (gfx::GetStringWidth(last, font_list) > width) 879 if (gfx::GetStringWidth(last, font_list) > width)
880 last = gfx::ElideText(last, font_list, width, gfx::ELIDE_TAIL); 880 last = gfx::ElideText(last, font_list, width, gfx::ELIDE_TAIL);
881 wrapped.resize(lines - 1); 881 wrapped.resize(lines - 1);
882 wrapped.push_back(last); 882 wrapped.push_back(last);
883 } 883 }
884 884
885 *actualLines = wrapped.size(); 885 *actualLines = wrapped.size();
886 return lines == 1 ? wrapped[0] 886 return lines == 1 ? wrapped[0] : JoinString(wrapped, '\n');
887 : base::JoinString(wrapped, base::ASCIIToUTF16("\n"));
888 } 887 }
889 888
890 - (base::string16)wrapText:(const base::string16&)text 889 - (base::string16)wrapText:(const base::string16&)text
891 forFont:(NSFont*)nsfont 890 forFont:(NSFont*)nsfont
892 maxNumberOfLines:(size_t)lines { 891 maxNumberOfLines:(size_t)lines {
893 size_t unused; 892 size_t unused;
894 return [self wrapText:text 893 return [self wrapText:text
895 forFont:nsfont 894 forFont:nsfont
896 maxNumberOfLines:lines 895 maxNumberOfLines:lines
897 actualLines:&unused]; 896 actualLines:&unused];
898 } 897 }
899 898
900 @end 899 @end
OLDNEW
« no previous file with comments | « ui/gl/gl_implementation.cc ('k') | ui/message_center/views/bounded_label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698