OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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_SYNC_CONFIRMATION_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_SYNC_CONFIRMATION_HANDLER_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 12 #include "components/signin/core/browser/account_tracker_service.h" |
| 13 #include "content/public/browser/web_ui_message_handler.h" |
| 14 |
| 15 class Browser; |
| 16 |
| 17 namespace base { |
| 18 class ListValue; |
| 19 } |
| 20 |
| 21 class SyncConfirmationHandler : public content::WebUIMessageHandler, |
| 22 public AccountTrackerService::Observer { |
| 23 public: |
| 24 SyncConfirmationHandler(); |
| 25 ~SyncConfirmationHandler() override; |
| 26 |
| 27 // content::WebUIMessageHandler: |
| 28 void RegisterMessages() override; |
| 29 |
| 30 // AccountTrackerService::Observer: |
| 31 void OnAccountUpdated(const AccountInfo& info) override; |
| 32 |
| 33 protected: |
| 34 // Handles "confirm" message from the page. No arguments. |
| 35 // This message is sent when the user confirms that they want complete sign in |
| 36 // with default sync settings. |
| 37 virtual void HandleConfirm(const base::ListValue* args); |
| 38 |
| 39 // Handles "undo" message from the page. No arguments. |
| 40 // This message is sent when the user clicks "undo" on the sync confirmation |
| 41 // dialog, which aborts signin and prevents sync from starting. |
| 42 virtual void HandleUndo(const base::ListValue* args); |
| 43 |
| 44 // Handles "initialized" message from the page. No arguments. |
| 45 // This message is sent when the sync confirmation dialog is finished being |
| 46 // initialized. |
| 47 virtual void HandleInitialized(const base::ListValue* args); |
| 48 |
| 49 // Handles "goToSettings" message from the page. No arguments. |
| 50 // This message is sent when the user clicks on the "Settings" link in the |
| 51 // sync confirmation dialog, which completes sign in but takes the user to the |
| 52 // sync settings page for configuration before starting sync. |
| 53 virtual void HandleGoToSettings(const base::ListValue* args); |
| 54 |
| 55 // Sets the profile picture shown in the dialog to the image at |url|. |
| 56 virtual void SetUserImageURL(const std::string& url); |
| 57 |
| 58 Browser* GetDesktopBrowser(); |
| 59 void CloseModalSigninWindow( |
| 60 LoginUIService::SyncConfirmationUIClosedResults results); |
| 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(SyncConfirmationHandler); |
| 63 }; |
| 64 |
| 65 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_SYNC_CONFIRMATION_HANDLER_H_ |
OLD | NEW |