| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_WELCOME_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_WELCOME_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_WELCOME_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_WELCOME_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/public/browser/web_ui_message_handler.h" | 9 #include "content/public/browser/web_ui_message_handler.h" |
| 10 #include "google_apis/gaia/oauth2_token_service.h" | 10 #include "google_apis/gaia/oauth2_token_service.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 ~WelcomeHandler() override; | 21 ~WelcomeHandler() override; |
| 22 | 22 |
| 23 // OAuth2TokenService::Observer: | 23 // OAuth2TokenService::Observer: |
| 24 void OnRefreshTokenAvailable(const std::string& account_id) override; | 24 void OnRefreshTokenAvailable(const std::string& account_id) override; |
| 25 | 25 |
| 26 // content::WebUIMessageHandler: | 26 // content::WebUIMessageHandler: |
| 27 void RegisterMessages() override; | 27 void RegisterMessages() override; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 enum WelcomeResult { | 30 enum WelcomeResult { |
| 31 DEFAULT = 0, | 31 DEFAULT = 0, // User navigated away from the page. |
| 32 SIGNED_IN, // User clicked the "Sign In" button and completed sign-in. | 32 DECLINED = 1, // User clicked the "No Thanks" button. |
| 33 DECLINED // User clicked the "No Thanks" button. | 33 SIGNED_IN = 2, // User clicked the "Sign In" button and completed sign-in. |
| 34 |
| 35 // New results must be added before this line, and should correspond to |
| 36 // values in tools/metrics/histograms/histograms.xml. |
| 37 WELCOME_RESULT_MAX |
| 34 }; | 38 }; |
| 35 | 39 |
| 36 void HandleActivateSignIn(const base::ListValue* args); | 40 void HandleActivateSignIn(const base::ListValue* args); |
| 37 void HandleUserDecline(const base::ListValue* args); | 41 void HandleUserDecline(const base::ListValue* args); |
| 38 void GoToNewTabPage(); | 42 void GoToNewTabPage(); |
| 39 | 43 |
| 40 Browser* GetBrowser(); | 44 Browser* GetBrowser(); |
| 41 | 45 |
| 42 Profile* profile_; | 46 Profile* profile_; |
| 43 ProfileOAuth2TokenService* oauth2_token_service_; | 47 ProfileOAuth2TokenService* oauth2_token_service_; |
| 44 WelcomeResult result_; | 48 WelcomeResult result_; |
| 45 | 49 |
| 46 DISALLOW_COPY_AND_ASSIGN(WelcomeHandler); | 50 DISALLOW_COPY_AND_ASSIGN(WelcomeHandler); |
| 47 }; | 51 }; |
| 48 | 52 |
| 49 #endif // CHROME_BROWSER_UI_WEBUI_WELCOME_HANDLER_H_ | 53 #endif // CHROME_BROWSER_UI_WEBUI_WELCOME_HANDLER_H_ |
| OLD | NEW |