OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_POLICY_H | |
6 #define IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_POLICY_H | |
7 | |
8 #import <ChromeWebView/cwv_export.h> | |
9 #import <Foundation/Foundation.h> | |
10 | |
11 NS_ASSUME_NONNULL_BEGIN | |
12 | |
13 @class CWVTranslationLanguage; | |
14 | |
15 typedef NS_ENUM(NSInteger, CWVTranslationPolicyType) { | |
16 CWVTranslationPolicyAsk = 1, // Prompt user on whether or not to translate. | |
17 CWVTranslationPolicyNever, // Never translate. | |
18 CWVTranslationPolicyAuto // Automatically translate according to policy. | |
19 }; | |
20 | |
21 // Represents a translation policy that can associated with another object like | |
22 // a language or website hostname. | |
23 CWV_EXPORT | |
24 @interface CWVTranslationPolicy : NSObject | |
25 | |
26 // 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.
| |
27 + (CWVTranslationPolicy*)translationPolicyAsk; | |
28 // 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.
| |
29 + (CWVTranslationPolicy*)translationPolicyNever; | |
30 // 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.
| |
31 + (CWVTranslationPolicy*)translationPolicyAutoTranslateToLanguage: | |
32 (CWVTranslationLanguage*)language; | |
33 | |
34 // Policy type. | |
35 @property(nonatomic, readonly) CWVTranslationPolicyType type; | |
36 | |
37 // Indicates the target language to automatically translate to. | |
38 // Nil unless |type| is CWVTranslationPolicyAuto. | |
michaeldo
2017/05/12 15:29:09
s/Nil/nil
jzw1
2017/05/15 02:43:33
Done.
| |
39 @property(nonatomic, readonly) CWVTranslationLanguage* language; | |
40 | |
41 @end | |
42 | |
43 NS_ASSUME_NONNULL_END | |
44 | |
45 #endif // IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_POLICY_H | |
OLD | NEW |