Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: chrome/browser/ui/android/infobars/translate_compact_infobar.h

Issue 2920953002: Auto-always/never can at most triggered twice (new translate infobar) (Closed)
Patch Set: fix Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/android/infobars/translate_compact_infobar.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/android/infobars/translate_compact_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698