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(); | |
xiyuan
2013/12/18 23:22:50
nit: remove explicit
guohui
2013/12/19 15:23:15
Done.
| |
23 virtual ~InlineLoginHandlerImpl(); | |
24 | |
25 private: | |
26 // InlineLoginHandler overrides: | |
27 virtual void RegisterMessages() OVERRIDE; | |
28 virtual void SetExtraInitParams(base::DictionaryValue& params) OVERRIDE; | |
29 virtual void CompleteLogin(const base::ListValue* args) OVERRIDE; | |
30 | |
31 // GaiaAuthConsumer override. | |
32 virtual void OnClientOAuthCodeSuccess(const std::string& oauth_code) OVERRIDE; | |
33 virtual void OnClientOAuthCodeFailure( | |
34 const GoogleServiceAuthError& error) OVERRIDE; | |
35 | |
36 // JS callback to switch the UI from a constrainted dialog to a full tab. | |
37 void HandleSwitchToFullTabMessage(const base::ListValue* args); | |
38 void HandleLoginError(const std::string& error_msg); | |
39 void SyncStarterCallback(OneClickSigninSyncStarter::SyncSetupResult result); | |
40 void CloseTab(); | |
41 | |
42 base::WeakPtrFactory<InlineLoginHandlerImpl> weak_factory_; | |
43 scoped_ptr<GaiaAuthFetcher> auth_fetcher_; | |
44 std::string email_; | |
45 std::string password_; | |
46 bool choose_what_to_sync_; | |
47 // Partition id for the gaia webview; | |
48 std::string partition_id_; | |
49 | |
50 DISALLOW_COPY_AND_ASSIGN(InlineLoginHandlerImpl); | |
51 }; | |
52 | |
53 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_HANDLER_IMPL_H_ | |
OLD | NEW |