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 <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 Loading... | |
| 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 |
| OLD | NEW |