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

Side by Side Diff: components/translate/core/browser/translate_infobar_delegate.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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_
6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 // Methods called by the extra-buttons that can appear on the "before 147 // Methods called by the extra-buttons that can appear on the "before
148 // translate" infobar (when the user has accepted/declined the translation 148 // translate" infobar (when the user has accepted/declined the translation
149 // several times). 149 // several times).
150 void AlwaysTranslatePageLanguage(); 150 void AlwaysTranslatePageLanguage();
151 void NeverTranslatePageLanguage(); 151 void NeverTranslatePageLanguage();
152 152
153 int GetTranslationAcceptedCount(); 153 int GetTranslationAcceptedCount();
154 int GetTranslationDeniedCount(); 154 int GetTranslationDeniedCount();
155 155
156 void ResetTranslationAcceptedCount();
157 void ResetTranslationDeniedCount();
158
159 #if defined(OS_ANDROID)
160 int GetTranslationAutoAlwaysCount();
161 int GetTranslationAutoNeverCount();
162
163 void IncrementTranslationAutoAlwaysCount();
164 void IncrementTranslationAutoNeverCount();
165 #endif
166
156 // The following methods are called by the infobar that displays the status 167 // The following methods are called by the infobar that displays the status
157 // while translating and also the one displaying the error message. 168 // while translating and also the one displaying the error message.
158 base::string16 GetMessageInfoBarText(); 169 base::string16 GetMessageInfoBarText();
159 base::string16 GetMessageInfoBarButtonText(); 170 base::string16 GetMessageInfoBarButtonText();
160 void MessageInfoBarButtonPressed(); 171 void MessageInfoBarButtonPressed();
161 bool ShouldShowMessageInfoBarButton(); 172 bool ShouldShowMessageInfoBarButton();
162 173
163 // Called by the before translate infobar to figure-out if it should show 174 // Called by the before translate infobar to figure-out if it should show
164 // an extra shortcut to let the user black-list/white-list that language 175 // an extra shortcut to let the user black-list/white-list that language
165 // (based on how many times the user accepted/declined translation). 176 // (based on how many times the user accepted/declined translation).
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 // A observer to handle front-end changes on different steps. 247 // A observer to handle front-end changes on different steps.
237 // It's only used when we try to reuse the existing UI. 248 // It's only used when we try to reuse the existing UI.
238 Observer* observer_; 249 Observer* observer_;
239 250
240 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); 251 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate);
241 }; 252 };
242 253
243 } // namespace translate 254 } // namespace translate
244 255
245 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ 256 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698