Chromium Code Reviews| 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, // 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 // Convenience constructors. | |
| 27 + (CWVTranslationPolicy*)translationPolicyAsk; | |
| 28 + (CWVTranslationPolicy*)translationPolicyNever; | |
| 29 + (CWVTranslationPolicy*)translationPolicyAutoTranslateToLanguage: | |
| 30 (CWVTranslationLanguage*)language; | |
| 31 | |
| 32 // Policy type. | |
| 33 @property(nonatomic, readonly) CWVTranslationPolicyType type; | |
| 34 | |
| 35 // Nil unless |type| is CWVTranslationPolicyAuto. | |
|
Hiroshi Ichikawa
2017/05/10 08:36:56
Can you add a comment that this is the language it
jzw1
2017/05/11 03:03:17
I'll just add some cmoments.
| |
| 36 @property(nonatomic, readonly) CWVTranslationLanguage* language; | |
| 37 | |
| 38 @end | |
| 39 | |
| 40 NS_ASSUME_NONNULL_END | |
| 41 | |
| 42 #endif // IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_POLICY_H | |
| OLD | NEW |