OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_WEB_AUTH_FLOW_WINDOW_H_ |
| 6 #define CHROME_BROWSER_UI_EXTENSIONS_WEB_AUTH_FLOW_WINDOW_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 |
| 11 class Profile; |
| 12 |
| 13 namespace content { |
| 14 class BrowserContext; |
| 15 class WebContents; |
| 16 } |
| 17 |
| 18 // Platform independent abstraction for a window that performs web auth flow. |
| 19 // Platform specific implementations implement this abstract class. |
| 20 class WebAuthFlowWindow { |
| 21 public: |
| 22 class Delegate { |
| 23 public: |
| 24 virtual void OnClose() = 0; |
| 25 }; |
| 26 |
| 27 // TODO(munjal): Allow customizing these? |
| 28 static const int kDefaultWidth = 1024; |
| 29 static const int kDefaultHeight = 768; |
| 30 |
| 31 // Creates a new instance of WebAuthFlowWindow with the given parmaters. |
| 32 // Delegate::OnClose will be called when the window is closed. |
| 33 static WebAuthFlowWindow* Create(Delegate* delegate, |
| 34 content::BrowserContext* browser_context, |
| 35 content::WebContents* contents); |
| 36 |
| 37 virtual ~WebAuthFlowWindow(); |
| 38 |
| 39 // Show the window. |
| 40 virtual void Show() = 0; |
| 41 |
| 42 protected: |
| 43 WebAuthFlowWindow(Delegate* delegate, |
| 44 content::BrowserContext* browser_context, |
| 45 content::WebContents* contents); |
| 46 |
| 47 Delegate* delegate() { return delegate_; } |
| 48 content::BrowserContext* browser_context() { return browser_context_; } |
| 49 content::WebContents* contents() { return contents_; } |
| 50 |
| 51 private: |
| 52 Delegate* delegate_; |
| 53 content::BrowserContext* browser_context_; |
| 54 content::WebContents* contents_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(WebAuthFlowWindow); |
| 57 }; |
| 58 |
| 59 #endif // CHROME_BROWSER_UI_EXTENSIONS_WEB_AUTH_FLOW_WINDOW_H_ |
OLD | NEW |