OLD | NEW |
---|---|
(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_ | |
OLD | NEW |