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

Side by Side Diff: ios/web_view/public/cwv_translation_controller.h

Issue 2872083003: Added translation policy API. (Closed)
Patch Set: added page host translation policies 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 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 #ifndef IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_CONTROLLER_H 5 #ifndef IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_CONTROLLER_H
6 #define IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_CONTROLLER_H 6 #define IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_CONTROLLER_H
7 7
8 #import <ChromeWebView/cwv_export.h> 8 #import <ChromeWebView/cwv_export.h>
9 #import <Foundation/Foundation.h> 9 #import <Foundation/Foundation.h>
10 10
11 NS_ASSUME_NONNULL_BEGIN 11 NS_ASSUME_NONNULL_BEGIN
12 12
13 @class CWVTranslationLanguage; 13 @class CWVTranslationLanguage;
14 @class CWVTranslationPolicy;
14 @protocol CWVTranslationControllerDelegate; 15 @protocol CWVTranslationControllerDelegate;
15 16
16 // The error domain for translation errors. 17 // The error domain for translation errors.
17 extern NSErrorDomain const CWVTranslationErrorDomain; 18 extern NSErrorDomain const CWVTranslationErrorDomain;
18 19
19 // Possible error codes during translation. 20 // Possible error codes during translation.
20 // No connectivity. 21 // No connectivity.
21 extern const NSInteger CWVTranslationErrorNetwork; 22 extern const NSInteger CWVTranslationErrorNetwork;
22 // The translation script failed to initialize. 23 // The translation script failed to initialize.
23 extern const NSInteger CWVTranslationErrorInitializationError; 24 extern const NSInteger CWVTranslationErrorInitializationError;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 toLanguage:(CWVTranslationLanguage*)targetLanguage; 58 toLanguage:(CWVTranslationLanguage*)targetLanguage;
58 59
59 // Reverts any translations done back to the original page language. 60 // Reverts any translations done back to the original page language.
60 // Note that the original page language may be different from |sourceLanguage| 61 // Note that the original page language may be different from |sourceLanguage|
61 // passed to |translatePageFromLanguage:toLanguage:| above. 62 // passed to |translatePageFromLanguage:toLanguage:| above.
62 // This must not be called before the |delegate| receives 63 // This must not be called before the |delegate| receives
63 // |translationController:didFinishLanguageDetectionWithResult:error:|. 64 // |translationController:didFinishLanguageDetectionWithResult:error:|.
64 // TODO(crbug.com/706289): Document what happens if you call this out of order. 65 // TODO(crbug.com/706289): Document what happens if you call this out of order.
65 - (void)revertTranslation; 66 - (void)revertTranslation;
66 67
68 // Save or retrieve translation policies associated with a specified language.
69 - (void)saveTranslationPolicy:(CWVTranslationPolicy*)policy
Hiroshi Ichikawa 2017/05/10 08:36:56 1. Maybe "set" not "save" to be consistent with st
jzw1 2017/05/11 03:03:17 Done.
70 language:(CWVTranslationLanguage*)language;
71 - (CWVTranslationPolicy*)translationPolicyForLanguage:
72 (CWVTranslationLanguage*)language;
73
74 // Save or retrieve translation policies associated with a specified page.
75 - (void)saveTranslationPolicy:(CWVTranslationPolicy*)policy
Hiroshi Ichikawa 2017/05/10 08:36:55 1. Maybe "set" not "save" to be consistent with st
jzw1 2017/05/11 03:03:17 Done.
76 pageHost:(NSString*)pageHost;
77 - (CWVTranslationPolicy*)translationPolicyForPageHost:(NSString*)pageHost;
78
67 @end 79 @end
68 80
69 NS_ASSUME_NONNULL_END 81 NS_ASSUME_NONNULL_END
70 82
71 #endif // IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_CONTROLLER_H 83 #endif // IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_CONTROLLER_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698