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

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

Issue 2838833003: Introduces snackbar enum, & other snackbar classes on android for translate (Closed)
Patch Set: Created 3 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_INFOBAR_ANDROID_H_ 5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_
6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_ 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 void ReassignJavaInfoBar(InfoBarAndroid* replacement); 48 void ReassignJavaInfoBar(InfoBarAndroid* replacement);
49 49
50 virtual void OnLinkClicked(JNIEnv* env, 50 virtual void OnLinkClicked(JNIEnv* env,
51 const base::android::JavaParamRef<jobject>& obj) {} 51 const base::android::JavaParamRef<jobject>& obj) {}
52 void OnButtonClicked(JNIEnv* env, 52 void OnButtonClicked(JNIEnv* env,
53 const base::android::JavaParamRef<jobject>& obj, 53 const base::android::JavaParamRef<jobject>& obj,
54 jint action); 54 jint action);
55 void OnCloseButtonClicked(JNIEnv* env, 55 void OnCloseButtonClicked(JNIEnv* env,
56 const base::android::JavaParamRef<jobject>& obj); 56 const base::android::JavaParamRef<jobject>& obj);
57 57
58 void CloseJavaInfoBar(); 58 virtual void CloseJavaInfoBar();
gone 2017/04/26 17:19:51 Yeah, I'm really wary of you overriding this one.
ramyasharma 2017/04/27 08:01:42 Thanks for tips on a different approach. But this
59 59
60 // Maps from a Chromium ID (IDR_TRANSLATE) to a enum value that Java code can 60 // Maps from a Chromium ID (IDR_TRANSLATE) to a enum value that Java code can
61 // translate into a Drawable ID using the ResourceId class. 61 // translate into a Drawable ID using the ResourceId class.
62 int GetEnumeratedIconId(); 62 int GetEnumeratedIconId();
63 63
64 // Acquire the java infobar from a different one. This is used to do in-place 64 // Acquire the java infobar from a different one. This is used to do in-place
65 // replacements. 65 // replacements.
66 virtual void PassJavaInfoBar(InfoBarAndroid* source) {} 66 virtual void PassJavaInfoBar(InfoBarAndroid* source) {}
67 67
68 protected: 68 protected:
69 // Derived classes must implement this method to process the corresponding 69 // Derived classes must implement this method to process the corresponding
70 // action. 70 // action.
71 virtual void ProcessButton(int action) = 0; 71 virtual void ProcessButton(int action) = 0;
72 72
73 void CloseInfoBar(); 73 void CloseInfoBar();
74 InfoBarAndroid* infobar_android() { return this; } 74 InfoBarAndroid* infobar_android() { return this; }
75 75
76 private: 76 private:
77 base::android::ScopedJavaGlobalRef<jobject> java_info_bar_; 77 base::android::ScopedJavaGlobalRef<jobject> java_info_bar_;
78 78
79 DISALLOW_COPY_AND_ASSIGN(InfoBarAndroid); 79 DISALLOW_COPY_AND_ASSIGN(InfoBarAndroid);
80 }; 80 };
81 81
82 // Registers the NativeInfoBar's native methods through JNI. 82 // Registers the NativeInfoBar's native methods through JNI.
83 bool RegisterNativeInfoBar(JNIEnv* env); 83 bool RegisterNativeInfoBar(JNIEnv* env);
84 84
85 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_ 85 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698