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

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

Issue 2872083003: Added translation policy API. (Closed)
Patch Set: addressed michael and eugene comments 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/public/cwv_translation_controller.h
diff --git a/ios/web_view/public/cwv_translation_controller.h b/ios/web_view/public/cwv_translation_controller.h
index 322965268cc4147208f1e96c33744d19d431d8fd..030b3c18e38f432db482978404a7d85e446d1a32 100644
--- a/ios/web_view/public/cwv_translation_controller.h
+++ b/ios/web_view/public/cwv_translation_controller.h
@@ -11,6 +11,7 @@
NS_ASSUME_NONNULL_BEGIN
@class CWVTranslationLanguage;
+@class CWVTranslationPolicy;
@protocol CWVTranslationControllerDelegate;
// The error domain for translation errors.
@@ -64,6 +65,19 @@ CWV_EXPORT
// TODO(crbug.com/706289): Document what happens if you call this out of order.
- (void)revertTranslation;
+// Sets or retrieves translation policies associated with a specified language.
+// |pageLanguage| should be the language code of the language.
Eugene But (OOO till 7-30) 2017/05/12 14:39:20 Do you want to use nullable annotations? Please do
jzw1 2017/05/15 02:43:31 The entire thing is wrapped in assume nonnull, whi
+- (void)setTranslationPolicy:(CWVTranslationPolicy*)policy
+ forPageLanguage:(CWVTranslationLanguage*)pageLanguage;
+- (CWVTranslationPolicy*)translationPolicyForPageLanguage:
+ (CWVTranslationLanguage*)pageLanguage;
+
+// Sets or retrieves translation policies associated with a specified page.
+// |pageHost| should be the hostname of the website.
+- (void)setTranslationPolicy:(CWVTranslationPolicy*)policy
+ forPageHost:(NSString*)pageHost;
+- (CWVTranslationPolicy*)translationPolicyForPageHost:(NSString*)pageHost;
+
@end
NS_ASSUME_NONNULL_END

Powered by Google App Engine
This is Rietveld 408576698