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

Unified Diff: ios/web/public/string_util.h

Issue 780873002: Upstream iOS web code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix gyp Created 6 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 side-by-side diff with in-line comments
Download patch
Index: ios/web/public/string_util.h
diff --git a/ios/web/public/string_util.h b/ios/web/public/string_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..b5b23b3897442fb86ad54c6fbdf04520f9437c25
--- /dev/null
+++ b/ios/web/public/string_util.h
@@ -0,0 +1,22 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_WEB_PUBLIC_STRING_UTIL_H_
+#define IOS_WEB_PUBLIC_STRING_UTIL_H_
+
+#include "base/strings/string16.h"
+
+namespace web {
+
+// Truncates |contents| to |length|.
+// Returns a string terminated at the last space to ensure no words are
+// clipped.
+// Note: This function uses spaces as word boundaries and may not handle all
+// languages correctly.
+base::string16 GetStringByClippingLastWord(const base::string16& contents,
+ size_t length);
+
+} // namespace web
+
+#endif // IOS_WEB_PUBLIC_STRING_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698