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

Side by Side Diff: chrome/browser/ui/android/infobars/translate_compact_infobar.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 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 18 matching lines...) Expand all
29 const base::android::JavaParamRef<jobject>& obj, 29 const base::android::JavaParamRef<jobject>& obj,
30 int option, 30 int option,
31 const base::android::JavaParamRef<jstring>& value); 31 const base::android::JavaParamRef<jstring>& value);
32 32
33 // JNI method specific to boolean settings in translate. 33 // JNI method specific to boolean settings in translate.
34 void ApplyBoolTranslateOption(JNIEnv* env, 34 void ApplyBoolTranslateOption(JNIEnv* env,
35 const base::android::JavaParamRef<jobject>& obj, 35 const base::android::JavaParamRef<jobject>& obj,
36 int option, 36 int option,
37 jboolean value); 37 jboolean value);
38 38
39 // Check whether we should automatically trigger "Always Translate".
40 bool ShouldAutoAlwaysTranslate();
41
39 // ContentTranslateDriver::Observer implementation. 42 // ContentTranslateDriver::Observer implementation.
40 void OnPageTranslated(const std::string& original_lang, 43 void OnPageTranslated(const std::string& original_lang,
41 const std::string& translated_lang, 44 const std::string& translated_lang,
42 translate::TranslateErrors::Type error_type) override; 45 translate::TranslateErrors::Type error_type) override;
43 46
44 private: 47 private:
45 // InfoBarAndroid: 48 // InfoBarAndroid:
46 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( 49 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar(
47 JNIEnv* env) override; 50 JNIEnv* env) override;
48 void ProcessButton(int action) override; 51 void ProcessButton(int action) override;
49 void SetJavaInfoBar( 52 void SetJavaInfoBar(
50 const base::android::JavaRef<jobject>& java_info_bar) override; 53 const base::android::JavaRef<jobject>& java_info_bar) override;
51 54
52 translate::TranslateInfoBarDelegate* GetDelegate(); 55 translate::TranslateInfoBarDelegate* GetDelegate();
53 translate::ContentTranslateDriver* translate_driver_; 56 translate::ContentTranslateDriver* translate_driver_;
54 57
55 DISALLOW_COPY_AND_ASSIGN(TranslateCompactInfoBar); 58 DISALLOW_COPY_AND_ASSIGN(TranslateCompactInfoBar);
56 }; 59 };
57 60
58 // Registers the native methods through JNI. 61 // Registers the native methods through JNI.
59 bool RegisterTranslateCompactInfoBar(JNIEnv* env); 62 bool RegisterTranslateCompactInfoBar(JNIEnv* env);
60 63
61 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_COMPACT_INFOBAR_H_ 64 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_COMPACT_INFOBAR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698