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