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

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

Issue 1150193004: Straighten up life cycle of native InfoBar pointers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed setNativeInfoBarPtr calls from child classes Created 5 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 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/jni_weak_ref.h" 10 #include "base/android/jni_weak_ref.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // Acquire the java infobar from a different one. This is used to do in-place 67 // Acquire the java infobar from a different one. This is used to do in-place
68 // replacements. 68 // replacements.
69 virtual void PassJavaInfoBar(InfoBarAndroid* source) {} 69 virtual void PassJavaInfoBar(InfoBarAndroid* source) {}
70 70
71 protected: 71 protected:
72 // Derived classes must implement this method to process the corresponding 72 // Derived classes must implement this method to process the corresponding
73 // action. 73 // action.
74 virtual void ProcessButton(int action, 74 virtual void ProcessButton(int action,
75 const std::string& action_value) = 0; 75 const std::string& action_value) = 0;
76 void CloseInfoBar(); 76 void CloseInfoBar();
77 InfoBarAndroid* infobar_android() { return this; }
77 78
78 private: 79 private:
79 base::android::ScopedJavaGlobalRef<jobject> java_info_bar_; 80 base::android::ScopedJavaGlobalRef<jobject> java_info_bar_;
80 81
81 DISALLOW_COPY_AND_ASSIGN(InfoBarAndroid); 82 DISALLOW_COPY_AND_ASSIGN(InfoBarAndroid);
82 }; 83 };
83 84
84 // Registers the NativeInfoBar's native methods through JNI. 85 // Registers the NativeInfoBar's native methods through JNI.
85 bool RegisterNativeInfoBar(JNIEnv* env); 86 bool RegisterNativeInfoBar(JNIEnv* env);
86 87
87 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_ 88 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698