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

Unified Diff: ios/web_view/public/cwv_language_detection_result.h

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/public/cwv_language_detection_result.h
diff --git a/ios/web_view/public/cwv_language_detection_result.h b/ios/web_view/public/cwv_language_detection_result.h
new file mode 100644
index 0000000000000000000000000000000000000000..f7d0c2eb454f846202f12fb32b554daba890b0ba
--- /dev/null
+++ b/ios/web_view/public/cwv_language_detection_result.h
@@ -0,0 +1,37 @@
+// 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.
+
+#ifndef IOS_WEB_VIEW_PUBLIC_CWV_LANGUAGE_DETECTION_RESULT_H
+#define IOS_WEB_VIEW_PUBLIC_CWV_LANGUAGE_DETECTION_RESULT_H
+
+#import <ChromeWebView/cwv_export.h>
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class CWVTranslationLanguage;
+
+// Encapsulates the results of language detection in one class.
+CWV_EXPORT
+@interface CWVLanguageDetectionResult : NSObject
+
+- (instancetype)init NS_UNAVAILABLE;
+
+// The detected language of the page.
+// Can be used to translate to |detectedOSLanguage|.
+@property(nonatomic, readonly) CWVTranslationLanguage* pageLanguage;
+
+// The detected language of the OS.
+// Can be used to translate from |detectedPageLanguage|.
+@property(nonatomic, readonly) CWVTranslationLanguage* OSLanguage;
+
+// The list of supported languages that can be used in translation.
+@property(nonatomic, readonly)
+ NSArray<CWVTranslationLanguage*>* supportedLanguages;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif // IOS_WEB_VIEW_PUBLIC_CWV_LANGUAGE_DETECTION_RESULT_H

Powered by Google App Engine
This is Rietveld 408576698