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

Side by Side Diff: ios/web_view/internal/translate/cwv_translation_language.mm

Issue 2872083003: Added translation policy API. (Closed)
Patch Set: sync Created 3 years, 6 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "ios/web_view/internal/translate/cwv_translation_language_internal.h" 5 #import "ios/web_view/internal/translate/cwv_translation_language_internal.h"
6 6
7 #include "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 9
10 #if !defined(__has_feature) || !__has_feature(objc_arc) 10 #if !defined(__has_feature) || !__has_feature(objc_arc)
11 #error "This file requires ARC support." 11 #error "This file requires ARC support."
12 #endif 12 #endif
13 13
14 @implementation CWVTranslationLanguage 14 @implementation CWVTranslationLanguage
15 15
16 @synthesize languageCode = _languageCode; 16 @synthesize languageCode = _languageCode;
17 @synthesize languageName = _languageName; 17 @synthesize languageName = _languageName;
18 18
19 - (instancetype)initWithLanguageCode:(const std::string&)languageCode 19 - (instancetype)initWithLanguageCode:(const std::string&)languageCode
20 languageName:(const base::string16&)languageName { 20 languageName:(const base::string16&)languageName {
21 self = [super init]; 21 self = [super init];
22 if (self) { 22 if (self) {
23 _languageCode = base::SysUTF8ToNSString(languageCode); 23 _languageCode = base::SysUTF8ToNSString(languageCode);
24 _languageName = base::SysUTF16ToNSString(languageName); 24 _languageName = base::SysUTF16ToNSString(languageName);
25 } 25 }
26 return self; 26 return self;
27 } 27 }
28 28
29 - (NSString*)description {
30 return [NSString stringWithFormat:@"%@ name:%@ code:%@", [super description],
31 _languageName, _languageCode];
32 }
33
29 @end 34 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698