Chromium Code Reviews| Index: ios/web_view/public/cwv_translation_policy.h |
| diff --git a/ios/web_view/public/cwv_translation_policy.h b/ios/web_view/public/cwv_translation_policy.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..10e1f85f67e80648079bcb9236e920087be16244 |
| --- /dev/null |
| +++ b/ios/web_view/public/cwv_translation_policy.h |
| @@ -0,0 +1,45 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_POLICY_H |
| +#define IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_POLICY_H |
| + |
| +#import <ChromeWebView/cwv_export.h> |
| +#import <Foundation/Foundation.h> |
| + |
| +NS_ASSUME_NONNULL_BEGIN |
| + |
| +@class CWVTranslationLanguage; |
| + |
| +typedef NS_ENUM(NSInteger, CWVTranslationPolicyType) { |
| + CWVTranslationPolicyAsk = 1, // Prompt user on whether or not to translate. |
| + CWVTranslationPolicyNever, // Never translate. |
| + CWVTranslationPolicyAuto // Automatically translate according to policy. |
| +}; |
| + |
| +// Represents a translation policy that can associated with another object like |
| +// a language or website hostname. |
| +CWV_EXPORT |
| +@interface CWVTranslationPolicy : NSObject |
| + |
| +// Creates a policy with CWVTranslationPolicyAsk. |
|
Eugene But (OOO till 7-30)
2017/05/12 14:39:20
"and null language"?
jzw1
2017/05/15 02:43:32
Done.
|
| ++ (CWVTranslationPolicy*)translationPolicyAsk; |
| +// Creates a policy with CWVTranslationPolicyNever. |
|
Eugene But (OOO till 7-30)
2017/05/12 14:39:20
ditto
jzw1
2017/05/15 02:43:33
Done.
|
| ++ (CWVTranslationPolicy*)translationPolicyNever; |
| +// Creates a policy with CWVTranslationPolicyAuto with language. |
|
Eugene But (OOO till 7-30)
2017/05/12 14:39:20
s/with/and the given ?
jzw1
2017/05/15 02:43:33
Done.
|
| ++ (CWVTranslationPolicy*)translationPolicyAutoTranslateToLanguage: |
| + (CWVTranslationLanguage*)language; |
| + |
| +// Policy type. |
| +@property(nonatomic, readonly) CWVTranslationPolicyType type; |
| + |
| +// Indicates the target language to automatically translate to. |
| +// Nil unless |type| is CWVTranslationPolicyAuto. |
|
michaeldo
2017/05/12 15:29:09
s/Nil/nil
jzw1
2017/05/15 02:43:33
Done.
|
| +@property(nonatomic, readonly) CWVTranslationLanguage* language; |
| + |
| +@end |
| + |
| +NS_ASSUME_NONNULL_END |
| + |
| +#endif // IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_POLICY_H |