Chromium Code Reviews| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 default (CWVTranslationPolicyAsk). | 55 // Resets all translation policies to default (CWVTranslationPolicyAsk). |
| 56 // Only resets non-incognito settings. | 56 // Only resets non-incognito settings. |
| 57 + (void)resetTranslationPolicies; | 57 + (void)resetTranslationPolicies; |
| 58 | 58 |
| 59 // Enables or disables the translate feature. Only applies to non-incognito. | |
|
Eugene But (OOO till 7-30)
2017/07/13 17:52:58
Why does it work only for non-incognito? If I disa
jzw1
2017/07/13 21:05:05
Refactored so that the user can configure for both
| |
| 60 + (BOOL)isTranslateEnabled; | |
|
Hiroshi Ichikawa
2017/07/13 07:28:59
Optional: Maybe it can be just "isEnabled" because
Eugene But (OOO till 7-30)
2017/07/13 17:52:58
Or isTranslationEnabled/setTranslationEnabled: to
jzw1
2017/07/13 21:05:05
I've renamed these in the new class CWVTranslation
| |
| 61 + (void)setTranslateEnabled:(BOOL)enabled; | |
| 62 | |
| 59 // Begins translation on the current page from |sourceLanguage| to | 63 // Begins translation on the current page from |sourceLanguage| to |
| 60 // |targetLanguage|. These language parameters must be chosen from | 64 // |targetLanguage|. These language parameters must be chosen from |
| 61 // |supportedLanguages|. Set |userInitiated| to YES if translation | 65 // |supportedLanguages|. Set |userInitiated| to YES if translation |
| 62 // is a result of explicit user action. |userInitiated| will be | 66 // is a result of explicit user action. |userInitiated| will be |
| 63 // passed along to the CWVTranslationControllerDelegate methods. | 67 // passed along to the CWVTranslationControllerDelegate methods. |
| 64 // Results in a No-op if there is no current page. | 68 // Results in a No-op if there is no current page. |
| 65 - (void)translatePageFromLanguage:(CWVTranslationLanguage*)sourceLanguage | 69 - (void)translatePageFromLanguage:(CWVTranslationLanguage*)sourceLanguage |
| 66 toLanguage:(CWVTranslationLanguage*)targetLanguage | 70 toLanguage:(CWVTranslationLanguage*)targetLanguage |
| 67 userInitiated:(BOOL)userInitiated; | 71 userInitiated:(BOOL)userInitiated; |
| 68 | 72 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 85 // Not supported in incognito mode. | 89 // Not supported in incognito mode. |
| 86 - (void)setTranslationPolicy:(CWVTranslationPolicy*)policy | 90 - (void)setTranslationPolicy:(CWVTranslationPolicy*)policy |
| 87 forPageHost:(NSString*)pageHost; | 91 forPageHost:(NSString*)pageHost; |
| 88 - (CWVTranslationPolicy*)translationPolicyForPageHost:(NSString*)pageHost; | 92 - (CWVTranslationPolicy*)translationPolicyForPageHost:(NSString*)pageHost; |
| 89 | 93 |
| 90 @end | 94 @end |
| 91 | 95 |
| 92 NS_ASSUME_NONNULL_END | 96 NS_ASSUME_NONNULL_END |
| 93 | 97 |
| 94 #endif // IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_CONTROLLER_H | 98 #endif // IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_CONTROLLER_H |
| OLD | NEW |