Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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_WELCOME_HANDLER_H_ | |
| 6 #define CHROME_BROWSER_UI_WEBUI_WELCOME_HANDLER_H_ | |
| 7 | |
| 8 #include "chrome/browser/profiles/profile.h" | |
|
michaelpg
2016/09/23 18:46:36
forward declare?
tmartino
2016/09/26 23:10:15
Forward Declarations are discouraged: https://engd
tmartino
2016/09/27 15:43:23
Whoops, I just saw that Chromium style contradicts
| |
| 9 #include "chrome/browser/ui/browser.h" | |
|
michaelpg
2016/09/23 18:46:36
forward declare?
| |
| 10 #include "components/signin/core/browser/profile_oauth2_token_service.h" | |
|
michaelpg
2016/09/23 18:46:36
forward declare?
| |
| 11 #include "content/public/browser/web_ui_message_handler.h" | |
| 12 #include "google_apis/gaia/oauth2_token_service.h" | |
| 13 | |
| 14 enum WelcomeResult { | |
|
michaelpg
2016/09/23 18:46:36
Can we scope this? e.g., inside WelcomeHandler
| |
| 15 DEFAULT = 0, | |
| 16 SIGNED_IN, // User clicked the "Sign In" button and completed sign-in. | |
| 17 DECLINED // User clicked the "No Thanks" button. | |
| 18 }; | |
| 19 | |
| 20 // Handles actions on Welcome page. | |
| 21 class WelcomeHandler : public content::WebUIMessageHandler, | |
| 22 public OAuth2TokenService::Observer { | |
| 23 public: | |
| 24 explicit WelcomeHandler(content::WebUI* web_ui); | |
| 25 ~WelcomeHandler() override; | |
| 26 void OnRefreshTokenAvailable(const std::string& account_id) override; | |
|
michaelpg
2016/09/23 18:46:36
indicate which type's functions this overrides, in
| |
| 27 void HandleActivateSignIn(const base::ListValue* args); | |
|
michaelpg
2016/09/23 18:46:35
private
| |
| 28 void HandleUserDecline(const base::ListValue* args); | |
|
michaelpg
2016/09/23 18:46:36
private
| |
| 29 void RegisterMessages() override; | |
|
michaelpg
2016/09/23 18:46:35
// content::WebUIMessageHandler:
| |
| 30 void GoToNewTabPage(); | |
|
michaelpg
2016/09/23 18:46:36
private
| |
| 31 | |
| 32 private: | |
| 33 Profile* profile_; | |
| 34 Browser* browser_; | |
| 35 ProfileOAuth2TokenService* oauth2_token_service_; | |
| 36 WelcomeResult result_; | |
| 37 }; | |
|
michaelpg
2016/09/23 18:46:36
consider adding DISALLOW_COPY_AND_ASSIGN
https://
| |
| 38 | |
| 39 #endif // CHROME_BROWSER_UI_WEBUI_WELCOME_HANDLER_H_ | |
| OLD | NEW |