Chromium Code Reviews| Index: chrome/browser/ui/webui/welcome_handler.h |
| diff --git a/chrome/browser/ui/webui/welcome_handler.h b/chrome/browser/ui/webui/welcome_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..333ce69112725a781111d1f22cb37c934de27291 |
| --- /dev/null |
| +++ b/chrome/browser/ui/webui/welcome_handler.h |
| @@ -0,0 +1,39 @@ |
| +// Copyright 2016 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_WEBUI_WELCOME_HANDLER_H_ |
| +#define CHROME_BROWSER_UI_WEBUI_WELCOME_HANDLER_H_ |
| + |
| +#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
|
| +#include "chrome/browser/ui/browser.h" |
|
michaelpg
2016/09/23 18:46:36
forward declare?
|
| +#include "components/signin/core/browser/profile_oauth2_token_service.h" |
|
michaelpg
2016/09/23 18:46:36
forward declare?
|
| +#include "content/public/browser/web_ui_message_handler.h" |
| +#include "google_apis/gaia/oauth2_token_service.h" |
| + |
| +enum WelcomeResult { |
|
michaelpg
2016/09/23 18:46:36
Can we scope this? e.g., inside WelcomeHandler
|
| + DEFAULT = 0, |
| + SIGNED_IN, // User clicked the "Sign In" button and completed sign-in. |
| + DECLINED // User clicked the "No Thanks" button. |
| +}; |
| + |
| +// Handles actions on Welcome page. |
| +class WelcomeHandler : public content::WebUIMessageHandler, |
| + public OAuth2TokenService::Observer { |
| + public: |
| + explicit WelcomeHandler(content::WebUI* web_ui); |
| + ~WelcomeHandler() override; |
| + void OnRefreshTokenAvailable(const std::string& account_id) override; |
|
michaelpg
2016/09/23 18:46:36
indicate which type's functions this overrides, in
|
| + void HandleActivateSignIn(const base::ListValue* args); |
|
michaelpg
2016/09/23 18:46:35
private
|
| + void HandleUserDecline(const base::ListValue* args); |
|
michaelpg
2016/09/23 18:46:36
private
|
| + void RegisterMessages() override; |
|
michaelpg
2016/09/23 18:46:35
// content::WebUIMessageHandler:
|
| + void GoToNewTabPage(); |
|
michaelpg
2016/09/23 18:46:36
private
|
| + |
| + private: |
| + Profile* profile_; |
| + Browser* browser_; |
| + ProfileOAuth2TokenService* oauth2_token_service_; |
| + WelcomeResult result_; |
| +}; |
|
michaelpg
2016/09/23 18:46:36
consider adding DISALLOW_COPY_AND_ASSIGN
https://
|
| + |
| +#endif // CHROME_BROWSER_UI_WEBUI_WELCOME_HANDLER_H_ |