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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_AUTO_LOGIN_INFOBAR_DELEGATE_ANDROID_H_
6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_AUTO_LOGIN_INFOBAR_DELEGATE_ANDROID_H_
8 #include "base/android/jni_helper.h"
9 #include "base/android/scoped_java_ref.h"
10 #include "chrome/browser/ui/auto_login_infobar_delegate.h"
12 class AutoLoginInfoBarDelegateAndroid
: public AutoLoginInfoBarDelegate
{
14 AutoLoginInfoBarDelegateAndroid(const Params
& params
, Profile
* profile
);
15 virtual ~AutoLoginInfoBarDelegateAndroid();
17 // AutoLoginInfoBarDelegate:
18 virtual bool Accept() OVERRIDE
;
19 virtual bool Cancel() OVERRIDE
;
20 virtual base::string16
GetMessageText() const OVERRIDE
;
22 // These methods are defined in downstream code.
23 bool AttachAccount(JavaObjectWeakGlobalRef weak_java_translate_helper
);
24 void LoginSuccess(JNIEnv
* env
, jobject obj
, jstring result
);
25 void LoginFailed(JNIEnv
* env
, jobject obj
);
26 void LoginDismiss(JNIEnv
* env
, jobject obj
);
28 // Register Android JNI bindings.
29 static bool Register(JNIEnv
* env
);
32 const std::string
& realm() const { return params_
.header
.realm
; }
33 const std::string
& account() const { return params_
.header
.account
; }
34 const std::string
& args() const { return params_
.header
.args
; }
36 JavaObjectWeakGlobalRef weak_java_auto_login_delegate_
;
40 DISALLOW_COPY_AND_ASSIGN(AutoLoginInfoBarDelegateAndroid
);
43 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_AUTO_LOGIN_INFOBAR_DELEGATE_ANDROID_H_