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

Unified Diff: chrome/browser/ui/sync/one_click_signin_helper.h

Issue 9453035: Implement one click login. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Cleanup old filenames from chrome_browser.gypi Created 8 years, 10 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
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_dialog.h ('k') | chrome/browser/ui/sync/one_click_signin_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/sync/one_click_signin_helper.h
===================================================================
--- chrome/browser/ui/sync/one_click_signin_helper.h (revision 0)
+++ chrome/browser/ui/sync/one_click_signin_helper.h (revision 0)
@@ -0,0 +1,67 @@
+// 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_SYNC_ONE_CLICK_SIGNIN_HELPER_H_
+#define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_
+#pragma once
+
+#include <string>
+
+#include "content/public/browser/web_contents_observer.h"
+
+namespace content {
+class WebContents;
+}
+
+namespace net {
+class URLRequest;
+}
+
+// Per-tab one-click signin helper. When a user signs in to a Google service
+// and the profile is not yet connected to a Google account, will start the
+// process of helping the user connect his profile with one click. The process
+// begins with an infobar and is followed with a confirmation dialog explaining
+// more about what this means.
+class OneClickSigninHelper : public content::WebContentsObserver {
+ public:
+ // Returns true if the one-click signin feature can be offered at this time.
+ // It can be offered if the contents is not in an incognito window.
+ static bool CanOffer(content::WebContents* web_contents);
+
+ // Looks for the X-Google-Accounts-SignIn response header, and if found,
+ // tries to display an infobar in the tab contents identified by the
+ // child/route id.
+ static void ShowInfoBarIfPossible(net::URLRequest* request,
+ int child_id,
+ int route_id);
+
+ explicit OneClickSigninHelper(content::WebContents* web_contents);
+ virtual ~OneClickSigninHelper();
+
+ private:
+ // The portion of ShowInfoBarIfPossible() that needs to run on the UI thread.
+ static void ShowInfoBarUIThread(const std::string& account,
+ int child_id,
+ int route_id);
+
+ // content::WebContentsObserver overrides.
+ virtual void DidNavigateAnyFrame(
+ const content::LoadCommittedDetails& details,
+ const content::FrameNavigateParams& params) OVERRIDE;
+ virtual void DidStopLoading() OVERRIDE;
+
+ // Save the email address that we can display the info bar correctly.
+ void SaveEmail(const std::string& email);
+
+ // Remember the user's password for later use.
+ void SavePassword(const std::string& password);
+
+ // Email address and password of the account that has just logged in.
+ std::string email_;
+ std::string password_;
+
+ DISALLOW_COPY_AND_ASSIGN(OneClickSigninHelper);
+};
+
+#endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_
Property changes on: chrome\browser\ui\sync\one_click_signin_helper.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_dialog.h ('k') | chrome/browser/ui/sync/one_click_signin_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698