| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_AUTO_LOGIN_INFOBAR_DELEGATE_ANDROID_H
_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_AUTO_LOGIN_INFOBAR_DELEGATE_ANDROID_H
_ |
| 5 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_AUTO_LOGIN_INFOBAR_DELEGATE_ANDROID_H
_ | 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_AUTO_LOGIN_INFOBAR_DELEGATE_ANDROID_H
_ |
| 6 | 7 |
| 7 #include "base/android/jni_helper.h" | 8 #include "base/android/jni_helper.h" |
| 8 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 9 #include "chrome/browser/ui/auto_login_infobar_delegate.h" | 10 #include "chrome/browser/ui/auto_login_infobar_delegate.h" |
| 10 | 11 |
| 11 class AutoLoginInfoBarDelegateAndroid : public AutoLoginInfoBarDelegate { | 12 class AutoLoginInfoBarDelegateAndroid : public AutoLoginInfoBarDelegate { |
| 12 public: | 13 public: |
| 13 AutoLoginInfoBarDelegateAndroid(InfoBarService* owner, const Params& params); | 14 AutoLoginInfoBarDelegateAndroid(InfoBarService* owner, const Params& params); |
| 14 virtual ~AutoLoginInfoBarDelegateAndroid(); | 15 virtual ~AutoLoginInfoBarDelegateAndroid(); |
| 15 | 16 |
| 16 // ConfirmInfoBarDelegate: | 17 // AutoLoginInfoBarDelegate: |
| 17 virtual bool Accept() OVERRIDE; | 18 virtual bool Accept() OVERRIDE; |
| 18 virtual bool Cancel() OVERRIDE; | 19 virtual bool Cancel() OVERRIDE; |
| 19 virtual string16 GetMessageText() const OVERRIDE; | 20 virtual string16 GetMessageText() const OVERRIDE; |
| 20 | 21 |
| 21 // These methods are defined in downstream code. | 22 // These methods are defined in downstream code. |
| 22 bool AttachAccount(JavaObjectWeakGlobalRef weak_java_translate_helper); | 23 bool AttachAccount(JavaObjectWeakGlobalRef weak_java_translate_helper); |
| 23 void LoginSuccess(JNIEnv* env, jobject obj, jstring result); | 24 void LoginSuccess(JNIEnv* env, jobject obj, jstring result); |
| 24 void LoginFailed(JNIEnv* env, jobject obj); | 25 void LoginFailed(JNIEnv* env, jobject obj); |
| 25 void LoginDismiss(JNIEnv* env, jobject obj); | 26 void LoginDismiss(JNIEnv* env, jobject obj); |
| 26 | 27 |
| 27 // Register Android JNI bindings. | 28 // Register Android JNI bindings. |
| 28 static bool Register(JNIEnv* env); | 29 static bool Register(JNIEnv* env); |
| 29 | 30 |
| 30 private: | 31 private: |
| 31 const std::string& realm() const { return params_.header.realm; } | 32 const std::string& realm() const { return params_.header.realm; } |
| 32 const std::string& account() const { return params_.header.account; } | 33 const std::string& account() const { return params_.header.account; } |
| 33 const std::string& args() const { return params_.header.args; } | 34 const std::string& args() const { return params_.header.args; } |
| 34 | 35 |
| 35 JavaObjectWeakGlobalRef weak_java_auto_login_delegate_; | 36 JavaObjectWeakGlobalRef weak_java_auto_login_delegate_; |
| 36 std::string user_; | 37 std::string user_; |
| 37 const Params params_; | 38 const Params params_; |
| 38 | 39 |
| 39 DISALLOW_COPY_AND_ASSIGN(AutoLoginInfoBarDelegateAndroid); | 40 DISALLOW_COPY_AND_ASSIGN(AutoLoginInfoBarDelegateAndroid); |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 | |
| 43 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_AUTO_LOGIN_INFOBAR_DELEGATE_ANDROI
D_H_ | 43 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_AUTO_LOGIN_INFOBAR_DELEGATE_ANDROI
D_H_ |
| 44 | 44 |
| OLD | NEW |