Chromium Code Reviews| Index: chrome/browser/ui/exclusive_access/exclusive_access_controller_manager.h |
| diff --git a/android_webview/native/aw_http_auth_handler.h b/chrome/browser/ui/exclusive_access/exclusive_access_controller_manager.h |
| similarity index 11% |
| copy from android_webview/native/aw_http_auth_handler.h |
| copy to chrome/browser/ui/exclusive_access/exclusive_access_controller_manager.h |
| index c063702a3e58def6fe250c200113044bb8147ed0..3b4ba412576b81cc93d26652b66488e5bd484b3d 100644 |
| --- a/android_webview/native/aw_http_auth_handler.h |
| +++ b/chrome/browser/ui/exclusive_access/exclusive_access_controller_manager.h |
| @@ -1,54 +1,62 @@ |
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2015 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_NATIVE_AW_HTTP_AUTH_HANDLER_H_ |
| -#define ANDROID_WEBVIEW_NATIVE_AW_HTTP_AUTH_HANDLER_H_ |
| +#ifndef CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTROLLER_MANAGER_H_ |
| +#define CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTROLLER_MANAGER_H_ |
| -#include <jni.h> |
| -#include <string> |
| +#include "base/memory/scoped_ptr.h" |
| +#include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h" |
| -#include "android_webview/browser/aw_login_delegate.h" |
| -#include "android_webview/browser/aw_http_auth_handler_base.h" |
| -#include "base/android/jni_android.h" |
| -#include "base/android/scoped_java_ref.h" |
| -#include "base/memory/ref_counted.h" |
| +class Browser; |
| +class BrowserWindow; |
| +class FullscreenController; |
| +class GURL; |
| +class MouseLockController; |
| namespace content { |
| class WebContents; |
| -}; |
| +} |
| -namespace net { |
| -class AuthChallengeInfo; |
| -}; |
| +// This class coordiates different exclusive access controllers and updates |
|
scheib
2015/01/14 22:37:59
Define "Exclusive access" as if you've just run in
Sriram
2015/01/15 00:34:28
Done.
|
| +// exclusive access control bubble accordingly. |
| +class ExclusiveAccessControllerManager { |
|
scheib
2015/01/14 22:37:59
Maybe just ExclusiveAccessManager
Sriram
2015/01/15 00:34:28
Done.
|
| + public: |
| + explicit ExclusiveAccessControllerManager(Browser* browser); |
| + ~ExclusiveAccessControllerManager(); |
| -namespace android_webview { |
| + FullscreenController* GetFullscreenController(); |
| + MouseLockController* GetMouseLockController(); |
| -// Native class for Java class of same name and owns an instance |
| -// of that Java object. |
| -// One instance of this class is created per underlying AwLoginDelegate. |
| -class AwHttpAuthHandler : public AwHttpAuthHandlerBase { |
| - public: |
| - AwHttpAuthHandler(AwLoginDelegate* login_delegate, |
| - net::AuthChallengeInfo* auth_info, |
| - bool first_auth_attempt); |
| - virtual ~AwHttpAuthHandler(); |
| + ExclusiveAccessBubbleType GetExclusiveAccessExitBubbleType() const; |
| + void UpdateExclusiveAccessExitBubbleContent(); |
| - // from AwHttpAuthHandler |
| - virtual bool HandleOnUIThread(content::WebContents* web_contents) override; |
| + GURL GetExclusiveAccessBubbleURL() const; |
| + // Callbacks //////////////////////////////////////////////////////////////// |
| - void Proceed(JNIEnv* env, jobject obj, jstring username, jstring password); |
| - void Cancel(JNIEnv* env, jobject obj); |
| + // Called by Browser::TabDeactivated. |
| + void OnTabDeactivated(content::WebContents* web_contents); |
| - private: |
| - scoped_refptr<AwLoginDelegate> login_delegate_; |
| - base::android::ScopedJavaGlobalRef<jobject> http_auth_handler_; |
| - std::string host_; |
| - std::string realm_; |
| -}; |
| + // Called by Browser::ActiveTabChanged. |
| + void OnTabDetachedFromView(content::WebContents* web_contents); |
| -bool RegisterAwHttpAuthHandler(JNIEnv* env); |
| + // Called by Browser::TabClosingAt. |
| + void OnTabClosing(content::WebContents* web_contents); |
| -} // namespace android_webview |
| + // Called by Browser::PreHandleKeyboardEvent |
| + bool HandleUserPressedEscape(); |
| + |
| + // Called by platform ExclusiveAccessExitBubble. |
| + void OnAcceptExclusiveAccessPermission(); |
| + void OnDenyExclusiveAccessPermission(); |
| + |
| + private: |
| + Browser* browser_; |
| + BrowserWindow* window_; |
| + scoped_ptr<FullscreenController> fullscreen_controller_; |
| + scoped_ptr<MouseLockController> mouse_lock_controller_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessControllerManager); |
| +}; |
| -#endif // ANDROID_WEBVIEW_NATIVE_AW_HTTP_AUTH_HANDLER_H_ |
| +#endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTROLLER_MANAGER_H_ |