OLD | NEW |
---|---|
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 <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 #import "cwv_export.h" | 10 #import "cwv_export.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 @interface CWVTranslationController : NSObject | 45 @interface CWVTranslationController : NSObject |
46 | 46 |
47 // Delegate to receive translation callbacks. | 47 // Delegate to receive translation callbacks. |
48 @property(nullable, nonatomic, weak) id<CWVTranslationControllerDelegate> | 48 @property(nullable, nonatomic, weak) id<CWVTranslationControllerDelegate> |
49 delegate; | 49 delegate; |
50 | 50 |
51 // The set of supported languages for translation. | 51 // The set of supported languages for translation. |
52 @property(nonatomic, readonly) | 52 @property(nonatomic, readonly) |
53 NSSet<CWVTranslationLanguage*>* supportedLanguages; | 53 NSSet<CWVTranslationLanguage*>* supportedLanguages; |
54 | 54 |
55 // Resets all translation policies to CWVTranslationPolicyAsk. | |
Hiroshi Ichikawa
2017/07/10 01:35:00
Can you document that this method only clears the
jzw1
2017/07/10 03:21:31
What if we clear both in this method? On second th
| |
56 + (void)resetTranslationPolicies; | |
57 | |
55 // Begins translation on the current page from |sourceLanguage| to | 58 // Begins translation on the current page from |sourceLanguage| to |
56 // |targetLanguage|. These language parameters must be chosen from | 59 // |targetLanguage|. These language parameters must be chosen from |
57 // |supportedLanguages|. Set |userInitiated| to YES if translation | 60 // |supportedLanguages|. Set |userInitiated| to YES if translation |
58 // is a result of explicit user action. |userInitiated| will be | 61 // is a result of explicit user action. |userInitiated| will be |
59 // passed along to the CWVTranslationControllerDelegate methods. | 62 // passed along to the CWVTranslationControllerDelegate methods. |
60 // Results in a No-op if there is no current page. | 63 // Results in a No-op if there is no current page. |
61 - (void)translatePageFromLanguage:(CWVTranslationLanguage*)sourceLanguage | 64 - (void)translatePageFromLanguage:(CWVTranslationLanguage*)sourceLanguage |
62 toLanguage:(CWVTranslationLanguage*)targetLanguage | 65 toLanguage:(CWVTranslationLanguage*)targetLanguage |
63 userInitiated:(BOOL)userInitiated; | 66 userInitiated:(BOOL)userInitiated; |
64 | 67 |
(...skipping 14 matching lines...) Expand all Loading... | |
79 // |pageHost| should be the hostname of the website. Must not be empty. | 82 // |pageHost| should be the hostname of the website. Must not be empty. |
80 - (void)setTranslationPolicy:(CWVTranslationPolicy*)policy | 83 - (void)setTranslationPolicy:(CWVTranslationPolicy*)policy |
81 forPageHost:(NSString*)pageHost; | 84 forPageHost:(NSString*)pageHost; |
82 - (CWVTranslationPolicy*)translationPolicyForPageHost:(NSString*)pageHost; | 85 - (CWVTranslationPolicy*)translationPolicyForPageHost:(NSString*)pageHost; |
83 | 86 |
84 @end | 87 @end |
85 | 88 |
86 NS_ASSUME_NONNULL_END | 89 NS_ASSUME_NONNULL_END |
87 | 90 |
88 #endif // IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_CONTROLLER_H | 91 #endif // IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_CONTROLLER_H |
OLD | NEW |