Chromium Code Reviews| 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 }; | |
|
sky
2012/05/16 23:17:11
Add a protected virtual destructor to make it clea
| |
| 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 explicit WebAuthFlowWindow(Delegate* delegate, | |
|
sky
2012/05/16 23:17:11
no explicit
Munjal (Google)
2012/05/16 23:33:44
Done.
| |
| 44 content::BrowserContext* browser_context, | |
| 45 content::WebContents* contents); | |
| 46 | |
| 47 Delegate* delegate_; | |
|
sky
2012/05/16 23:17:11
Style guide says no protected members.
Munjal (Google)
2012/05/16 23:33:44
Done.
| |
| 48 content::BrowserContext* browser_context_; | |
| 49 content::WebContents* contents_; | |
| 50 | |
| 51 private: | |
| 52 DISALLOW_COPY_AND_ASSIGN(WebAuthFlowWindow); | |
| 53 }; | |
| 54 | |
| 55 #endif // CHROME_BROWSER_UI_EXTENSIONS_WEB_AUTH_FLOW_WINDOW_H_ | |
| OLD | NEW |