Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2947)

Unified Diff: chrome/browser/ui/extensions/web_auth_flow_window.h

Issue 10178020: Start implementing an auth flow for platform apps to be able to do auth (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/extensions/web_auth_flow_window.h
===================================================================
--- chrome/browser/ui/extensions/web_auth_flow_window.h (revision 0)
+++ chrome/browser/ui/extensions/web_auth_flow_window.h (revision 0)
@@ -0,0 +1,61 @@
+// 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 CHROME_BROWSER_UI_EXTENSIONS_WEB_AUTH_FLOW_WINDOW_H_
+#define CHROME_BROWSER_UI_EXTENSIONS_WEB_AUTH_FLOW_WINDOW_H_
+#pragma once
+
+#include "base/basictypes.h"
+
+class Profile;
+
+namespace content {
+class BrowserContext;
+class WebContents;
+}
+
+class WebAuthFlowWindow {
Mihai Parparita -not on Chrome 2012/05/14 20:59:39 Add a brief class-level comment indicating that th
Munjal (Google) 2012/05/15 00:55:20 Done.
+ public:
+ class Delegate {
+ public:
+ virtual void OnClose() = 0;
+ };
+
+ // TODO(munjal): Allow customizing these?
+ static const int kDefaultWidth = 1024;
+ static const int kDefaultHeight = 768;
+
+ // Creates a new instance of WebAuthFlowWindow with the given parmaters.
+ // Delegate::OnClose will be called when the window is closed.
+ static WebAuthFlowWindow* Create(Delegate* delegate,
+ content::BrowserContext* browser_context,
+ content::WebContents* contents);
+
+ virtual ~WebAuthFlowWindow();
+
+ // Show the window.
+ virtual void Show() = 0;
+
+ protected:
+ explicit WebAuthFlowWindow(Delegate* delegate,
+ content::BrowserContext* browser_context,
+ content::WebContents* contents);
+
+ // Instantiates a platform-specific WebAuthFlowWindow subclass (one
+ // implementation per platform). Public users of WebAuthFlowWindow should use
+ // WebAuthFlowWindow::Create.
+ static WebAuthFlowWindow* CreateWebAuthFlowWindow(
+ Delegate* delegate,
+ content::BrowserContext* browser_context,
+ content::WebContents* contents);
+
+ Delegate* delegate_;
+ content::BrowserContext* browser_context_;
+ content::WebContents* contents_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(WebAuthFlowWindow);
+};
+
+#endif // CHROME_BROWSER_UI_EXTENSIONS_WEB_AUTH_FLOW_WINDOW_H_

Powered by Google App Engine
This is Rietveld 408576698