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

Unified Diff: ios/web_view/internal/translate/cwv_translation_language.mm

Issue 2839093002: Implemented new Translate API for purely Objective-C clients. (Closed)
Patch Set: merge Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ios/web_view/internal/translate/cwv_translation_language.mm
diff --git a/ios/web_view/internal/translate/cwv_translation_language.mm b/ios/web_view/internal/translate/cwv_translation_language.mm
new file mode 100644
index 0000000000000000000000000000000000000000..2edc88dc2ce20d7434686bf51069da666c9f93e9
--- /dev/null
+++ b/ios/web_view/internal/translate/cwv_translation_language.mm
@@ -0,0 +1,29 @@
+// Copyright 2017 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.
+
+#import "ios/web_view/internal/translate/cwv_translation_language_internal.h"
+
+#include "base/strings/string16.h"
+#include "base/strings/sys_string_conversions.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+@implementation CWVTranslationLanguage
+
+@synthesize languageCode = _languageCode;
+@synthesize languageName = _languageName;
+
+- (instancetype)initWithLanguageCode:(const std::string&)languageCode
+ languageName:(const base::string16&)languageName {
+ self = [super init];
+ if (self) {
+ _languageCode = base::SysUTF8ToNSString(languageCode);
+ _languageName = base::SysUTF16ToNSString(languageName);
+ }
+ return self;
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698