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

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

Issue 2839093002: Implemented new Translate API for purely Objective-C clients. (Closed)
Patch Set: added TODO Created 3 years, 8 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_language_detection_result.mm
diff --git a/ios/web_view/internal/translate/cwv_language_detection_result.mm b/ios/web_view/internal/translate/cwv_language_detection_result.mm
new file mode 100644
index 0000000000000000000000000000000000000000..c659c9990d973d4912469bed20614d7242df6c03
--- /dev/null
+++ b/ios/web_view/internal/translate/cwv_language_detection_result.mm
@@ -0,0 +1,33 @@
+// 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_language_detection_result.h"
+
+#import "ios/web_view/internal/translate/cwv_language_detection_result_internal.h"
+#import "ios/web_view/public/cwv_translation_language.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+@implementation CWVLanguageDetectionResult
+
+@synthesize pageLanguage = _pageLanguage;
+@synthesize OSLanguage = _OSLanguage;
+@synthesize supportedLanguages = _supportedLanguages;
+
+- (instancetype)initWithPageLanguage:(CWVTranslationLanguage*)pageLanguage
+ OSLanguage:(CWVTranslationLanguage*)OSLanguage
+ supportedLanguages:
+ (NSArray<CWVTranslationLanguage*>*)supportedLanguages {
+ self = [super init];
+ if (self) {
+ _pageLanguage = pageLanguage;
+ _OSLanguage = OSLanguage;
+ _supportedLanguages = supportedLanguages;
Eugene But (OOO till 7-30) 2017/04/27 13:08:08 [supportedLanguages copy] ?
jzw1 2017/04/28 02:34:54 it was copied on its way in, do you prefer to have
Eugene But (OOO till 7-30) 2017/04/28 03:07:28 I don't think this code should make assumptions ab
Eugene But (OOO till 7-30) 2017/04/28 07:18:07 Please look at this comment
+ }
+ return self;
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698