| OLD | NEW |
| 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_READER_MODE_INFOBAR_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_READER_MODE_INFOBAR_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_READER_MODE_INFOBAR_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_READER_MODE_INFOBAR_H_ |
| 7 | 7 |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chrome/browser/ui/android/infobars/infobar_android.h" | 11 #include "chrome/browser/ui/android/infobars/infobar_android.h" |
| 12 #include "components/infobars/core/infobar_delegate.h" | 12 #include "components/infobars/core/infobar_delegate.h" |
| 13 | 13 |
| 14 class ReaderModeInfoBarDelegate; | 14 class ReaderModeInfoBarDelegate; |
| 15 | 15 |
| 16 class ReaderModeInfoBar : public InfoBarAndroid { | 16 class ReaderModeInfoBar : public InfoBarAndroid { |
| 17 public: | 17 public: |
| 18 explicit ReaderModeInfoBar( | 18 explicit ReaderModeInfoBar( |
| 19 std::unique_ptr<ReaderModeInfoBarDelegate> delegate); | 19 std::unique_ptr<ReaderModeInfoBarDelegate> delegate); |
| 20 ~ReaderModeInfoBar() override; | 20 ~ReaderModeInfoBar() override; |
| 21 | 21 |
| 22 void Hide(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 23 |
| 22 protected: | 24 protected: |
| 23 infobars::InfoBarDelegate* GetDelegate(); | 25 infobars::InfoBarDelegate* GetDelegate(); |
| 24 | 26 |
| 25 // InfoBarAndroid overrides. | 27 // InfoBarAndroid overrides. |
| 26 void ProcessButton(int action) override; | 28 void ProcessButton(int action) override; |
| 27 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( | 29 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( |
| 28 JNIEnv* env) override; | 30 JNIEnv* env) override; |
| 29 | 31 |
| 30 private: | 32 private: |
| 31 DISALLOW_COPY_AND_ASSIGN(ReaderModeInfoBar); | 33 DISALLOW_COPY_AND_ASSIGN(ReaderModeInfoBar); |
| 32 }; | 34 }; |
| 33 | 35 |
| 34 // Register native methods. | 36 // Register native methods. |
| 35 bool RegisterReaderModeInfoBar(JNIEnv* env); | 37 bool RegisterReaderModeInfoBar(JNIEnv* env); |
| 36 | 38 |
| 37 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_READER_MODE_INFOBAR_H_ | 39 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_READER_MODE_INFOBAR_H_ |
| OLD | NEW |