summaryrefslogtreecommitdiffstats
path: root/android_webview/browser/aw_http_auth_handler_base.h
blob: e72003b2a6f819b4cd146acefb8cc809649701cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ANDROID_WEBVIEW_BROWSER_AW_HTTP_AUTH_HANDLER_BASE_H_
#define ANDROID_WEBVIEW_BROWSER_AW_HTTP_AUTH_HANDLER_BASE_H_

namespace content {
class WebContents;
};

namespace net {
class AuthChallengeInfo;
};

namespace android_webview {

class AwLoginDelegate;

// browser/ layer interface for AwHttpAuthHandler (which is implemented in the
// native/ layer as a native version of the Java class of the same name). This
// allows the browser/ layer to be unaware of JNI/Java shenanigans.
class AwHttpAuthHandlerBase {
 public:
  static AwHttpAuthHandlerBase* Create(AwLoginDelegate* login_delegate,
                                       net::AuthChallengeInfo* auth_info,
                                       bool first_auth_attempt);
  virtual ~AwHttpAuthHandlerBase();

  // Provides an 'escape-hatch' out to Java for the browser/ layer
  // AwLoginDelegate.
  virtual bool HandleOnUIThread(content::WebContents*) = 0;
};

}  // namespace android_webview

#endif  // ANDROID_WEBVIEW_BROWSER_AW_HTTP_AUTH_HANDLER_BASE_H_