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

Side by Side Diff: components/translate/core/browser/translate_infobar_delegate.h

Issue 2871783003: Automatically trigger Always-Translate in new translation infobar (Closed)
Patch Set: fix Created 3 years, 7 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 bool ShouldShowMessageInfoBarButton(); 160 bool ShouldShowMessageInfoBarButton();
161 161
162 // Called by the before translate infobar to figure-out if it should show 162 // Called by the before translate infobar to figure-out if it should show
163 // an extra shortcut to let the user black-list/white-list that language 163 // an extra shortcut to let the user black-list/white-list that language
164 // (based on how many times the user accepted/declined translation). 164 // (based on how many times the user accepted/declined translation).
165 // The shortcut itself is platform specific, it can be a button or a new bar 165 // The shortcut itself is platform specific, it can be a button or a new bar
166 // for example. 166 // for example.
167 bool ShouldShowNeverTranslateShortcut(); 167 bool ShouldShowNeverTranslateShortcut();
168 bool ShouldShowAlwaysTranslateShortcut(); 168 bool ShouldShowAlwaysTranslateShortcut();
169 169
170 // Called by translate compact infobar. This check whether we should
171 // automatically trigger "Always Translate".
172 bool ShouldAutoAlwaysTranslate();
173
170 #if defined(OS_IOS) 174 #if defined(OS_IOS)
171 // Shows the Infobar offering to never translate the language or the site. 175 // Shows the Infobar offering to never translate the language or the site.
172 void ShowNeverTranslateInfobar(); 176 void ShowNeverTranslateInfobar();
173 #endif 177 #endif
174 178
175 // Adds the strings that should be displayed in the after translate infobar to 179 // Adds the strings that should be displayed in the after translate infobar to
176 // |strings|. If |autodetermined_source_language| is false, the text in that 180 // |strings|. If |autodetermined_source_language| is false, the text in that
177 // infobar is: 181 // infobar is:
178 // "The page has been translated from <lang1> to <lang2>." 182 // "The page has been translated from <lang1> to <lang2>."
179 // Otherwise: 183 // Otherwise:
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 236
233 // Whether the translation was triggered via a menu click vs automatically 237 // Whether the translation was triggered via a menu click vs automatically
234 // (due to language detection, preferences...) 238 // (due to language detection, preferences...)
235 bool triggered_from_menu_; 239 bool triggered_from_menu_;
236 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); 240 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate);
237 }; 241 };
238 242
239 } // namespace translate 243 } // namespace translate
240 244
241 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ 245 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698