Chromium Code Reviews| 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..7769a64acaae2d8d4f494cf0d7e6cf73799756ae |
| --- /dev/null |
| +++ b/ios/web_view/internal/translate/cwv_translation_language.mm |
| @@ -0,0 +1,30 @@ |
| +// 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/public/cwv_translation_language.h" |
| + |
| +#include "base/strings/string16.h" |
| +#include "base/strings/sys_string_conversions.h" |
| +#import "ios/web_view/internal/translate/cwv_translation_language_internal.h" |
|
michaeldo
2017/05/01 18:25:37
We can replace the import of cwv_translation_langu
jzw1
2017/05/08 03:36:28
Done.
|
| + |
| +#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 |