| 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 CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_COMPACT_INFOBAR_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_COMPACT_INFOBAR_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_COMPACT_INFOBAR_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_COMPACT_INFOBAR_H_ |
| 7 | 7 |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "chrome/browser/translate/chrome_translate_client.h" | 10 #include "chrome/browser/translate/chrome_translate_client.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 FLAG_NEVER_SITE = 1 << 4, | 78 FLAG_NEVER_SITE = 1 << 4, |
| 79 FLAG_EXPAND_MENU = 1 << 5, | 79 FLAG_EXPAND_MENU = 1 << 5, |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 // If number of consecutive translations is equal to this number, infobar will | 82 // If number of consecutive translations is equal to this number, infobar will |
| 83 // automatically trigger "Always Translate". | 83 // automatically trigger "Always Translate". |
| 84 const int kAcceptCountThreshold = 5; | 84 const int kAcceptCountThreshold = 5; |
| 85 // If number of consecutive denied is equal to this number, infobar will | 85 // If number of consecutive denied is equal to this number, infobar will |
| 86 // automatically trigger "Never Translate Language". | 86 // automatically trigger "Never Translate Language". |
| 87 const int kDeniedCountThreshold = 7; | 87 const int kDeniedCountThreshold = 7; |
| 88 // Maximum number of times to trigger "Always Translate" automatically. |
| 89 const int kMaxNumberOfAutoAlways = 2; |
| 90 // Maximum number of times to trigger "Never Translate" automatically. |
| 91 const int kMaxNumberOfAutoNever = 2; |
| 88 | 92 |
| 89 DISALLOW_COPY_AND_ASSIGN(TranslateCompactInfoBar); | 93 DISALLOW_COPY_AND_ASSIGN(TranslateCompactInfoBar); |
| 90 }; | 94 }; |
| 91 | 95 |
| 92 // Registers the native methods through JNI. | 96 // Registers the native methods through JNI. |
| 93 bool RegisterTranslateCompactInfoBar(JNIEnv* env); | 97 bool RegisterTranslateCompactInfoBar(JNIEnv* env); |
| 94 | 98 |
| 95 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_COMPACT_INFOBAR_H_ | 99 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_COMPACT_INFOBAR_H_ |
| OLD | NEW |