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_SIGNIN_SIGNIN_ERROR_HANDLER_H_ | |
| 6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_SIGNIN_ERROR_HANDLER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "content/public/browser/web_ui_message_handler.h" | |
| 12 | |
| 13 class Browser; | |
| 14 class ProfileAttributesEntry; | |
| 15 | |
| 16 namespace base { | |
| 17 class ListValue; | |
| 18 } | |
| 19 | |
| 20 class SigninErrorHandler : public content::WebUIMessageHandler { | |
| 21 public: | |
| 22 SigninErrorHandler() : duplicate_profile_entry_(nullptr) {} | |
| 23 ~SigninErrorHandler() override {} | |
| 24 | |
| 25 // content::WebUIMessageHandler: | |
| 26 void RegisterMessages() override; | |
| 27 | |
| 28 // Sets the existing profile entry that has the same username used for signin. | |
| 29 // This function is called when the signin error is a duplicate account error. | |
| 30 void set_duplicate_profile_entry( | |
| 31 const ProfileAttributesEntry* duplicate_profile_entry); | |
| 32 | |
| 33 protected: | |
| 34 // Handles "switch" message from the page. No arguments. | |
| 35 // This message is sent when the user switches to the existing profile of the | |
| 36 // same username used for signin. | |
| 37 virtual void HandleSwitch(const base::ListValue* args); | |
|
anthonyvd
2016/08/22 14:58:46
Can you make this function name a bit more descrip
Jane
2016/08/22 20:48:31
Done.
| |
| 38 | |
| 39 // Handles "confirm" message from the page. No arguments. | |
| 40 // This message is sent when the user acknowledges the signin error. | |
| 41 virtual void HandleConfirm(const base::ListValue* args); | |
| 42 | |
| 43 // Handles "learnMore" message from the page. No arguments. | |
| 44 // This message is sent when the user clicks on the "Learn more" link in the | |
| 45 // signin error dialog, which closes the dialog and takes the user to the | |
| 46 // Chrome Help page about fixing sync problems. | |
| 47 virtual void HandleLearnMore(const base::ListValue* args); | |
| 48 | |
| 49 // Handles the web ui message sent when the html content is done being laid | |
| 50 // out and it's time to resize the native view hosting it to fit. |args| is | |
| 51 // a single integer value for the height the native view should resize to. | |
| 52 virtual void HandleInitializedWithSize(const base::ListValue* args); | |
| 53 | |
| 54 Browser* GetDesktopBrowser(); | |
| 55 void CloseDialog(); | |
| 56 | |
| 57 private: | |
| 58 const ProfileAttributesEntry* duplicate_profile_entry_; | |
| 59 | |
| 60 DISALLOW_COPY_AND_ASSIGN(SigninErrorHandler); | |
| 61 }; | |
| 62 | |
| 63 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_SIGNIN_ERROR_HANDLER_H_ | |
| OLD | NEW |