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

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

Issue 2838833003: Introduces snackbar enum, & other snackbar classes on android for translate (Closed)
Patch Set: 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 23 matching lines...) Expand all
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 // ContentTranslateDriver::Observer implementation. 39 // ContentTranslateDriver::Observer implementation.
40 void OnPageTranslated(const std::string& original_lang, 40 void OnPageTranslated(const std::string& original_lang,
41 const std::string& translated_lang, 41 const std::string& translated_lang,
42 translate::TranslateErrors::Type error_type) override; 42 translate::TranslateErrors::Type error_type) override;
43 43
44 // JNI method to show snackbar on Android.
45 void ShowSnackbar(JNIEnv* env,
46 const base::android::JavaParamRef<jobject>& obj);
47
44 private: 48 private:
45 // InfoBarAndroid: 49 // InfoBarAndroid:
46 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( 50 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar(
47 JNIEnv* env) override; 51 JNIEnv* env) override;
48 void ProcessButton(int action) override; 52 void ProcessButton(int action) override;
49 void SetJavaInfoBar( 53 void SetJavaInfoBar(
50 const base::android::JavaRef<jobject>& java_info_bar) override; 54 const base::android::JavaRef<jobject>& java_info_bar) override;
51 55
52 translate::TranslateInfoBarDelegate* GetDelegate(); 56 translate::TranslateInfoBarDelegate* GetDelegate();
53 translate::ContentTranslateDriver* translate_driver_; 57 translate::ContentTranslateDriver* translate_driver_;
54 58
59 int snackbar_type_;
60
55 DISALLOW_COPY_AND_ASSIGN(TranslateCompactInfoBar); 61 DISALLOW_COPY_AND_ASSIGN(TranslateCompactInfoBar);
56 }; 62 };
57 63
58 // Registers the native methods through JNI. 64 // Registers the native methods through JNI.
59 bool RegisterTranslateCompactInfoBar(JNIEnv* env); 65 bool RegisterTranslateCompactInfoBar(JNIEnv* env);
60 66
61 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_COMPACT_INFOBAR_H_ 67 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_COMPACT_INFOBAR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698