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

Side by Side Diff: chrome/browser/ui/webui/signin/inline_login_handler_impl.h

Issue 118343003: Refactor inline_login_ui (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 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_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_
6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h"
10 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h"
11 #include "chrome/browser/ui/webui/signin/inline_login_handler.h"
12 #include "google_apis/gaia/gaia_auth_consumer.h"
13
14 class GaiaAuthFetcher;
15
16 // Implementation for the inline login WebUI handler on desktop Chrome. Once
17 // CrOS migrates to the same webview approach as desktop Chrome, much of the
18 // code in this class should move to its base class |InlineLoginHandler|.
19 class InlineLoginHandlerImpl : public GaiaAuthConsumer,
20 public InlineLoginHandler {
21 public:
22 explicit InlineLoginHandlerImpl();
23 virtual ~InlineLoginHandlerImpl();
24
25 protected:
xiyuan 2013/12/18 21:27:59 nit: remove since no need to have empty section.
guohui 2013/12/18 22:39:17 Done.
26
27 private:
28 // InlineLoginHandler overrides:
29 virtual void RegisterMessages() OVERRIDE;
30 virtual void SetExtraInitParams(base::DictionaryValue& params) OVERRIDE;
31 virtual void CompleteLogin(const base::ListValue* args) OVERRIDE;
32
33 // GaiaAuthConsumer override.
34 virtual void OnClientOAuthCodeSuccess(const std::string& oauth_code) OVERRIDE;
35 virtual void OnClientOAuthCodeFailure(
36 const GoogleServiceAuthError& error) OVERRIDE;
37
38 // JS callback to switch the UI from a constrainted dialog to a full tab.
39 void HandleSwitchToFullTabMessage(const base::ListValue* args);
40 void HandleLoginError(const std::string& error_msg);
41 void SyncStarterCallback(OneClickSigninSyncStarter::SyncSetupResult result);
42 void CloseTab();
43
44 base::WeakPtrFactory<InlineLoginHandlerImpl> weak_factory_;
45 scoped_ptr<GaiaAuthFetcher> auth_fetcher_;
46 std::string email_;
47 std::string password_;
48 bool choose_what_to_sync_;
49 // Partition id for the gaia webview;
50 std::string partition_id_;
51
52 DISALLOW_COPY_AND_ASSIGN(InlineLoginHandlerImpl);
53 };
54
55 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698