Chromium Code Reviews| Index: chrome/browser/ui/webui/signin/sync_confirmation_handler.h |
| diff --git a/chrome/browser/ui/webui/signin/sync_confirmation_handler.h b/chrome/browser/ui/webui/signin/sync_confirmation_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..54f63c5d915fd5c561fd259117c72752573448fe |
| --- /dev/null |
| +++ b/chrome/browser/ui/webui/signin/sync_confirmation_handler.h |
| @@ -0,0 +1,56 @@ |
| +// Copyright 2015 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_SIGNIN_SYNC_CONFIRMATION_HANDLER_H_ |
| +#define CHROME_BROWSER_UI_WEBUI_SIGNIN_SYNC_CONFIRMATION_HANDLER_H_ |
| + |
|
Dan Beam
2016/01/13 23:45:22
nit: #include <string>
anthonyvd
2016/01/18 21:40:08
Done.
|
| +#include "base/macros.h" |
| +#include "components/signin/core/browser/account_tracker_service.h" |
| +#include "content/public/browser/web_ui_message_handler.h" |
| + |
| +namespace base { |
| +class ListValue; |
| +} |
| + |
| +class SyncConfirmationHandler : public content::WebUIMessageHandler, |
| + public AccountTrackerService::Observer { |
| + public: |
| + SyncConfirmationHandler(); |
| + ~SyncConfirmationHandler() override; |
| + |
| + // content::WebUIMessageHandler: |
| + void RegisterMessages() override; |
| + |
| + // AccountTrackerService::Observer: |
| + void OnAccountUpdated(const AccountInfo& info) override; |
| + |
| + private: |
| + // Handles "confirm" message from the page. No arguments. |
| + // This message is sent when the user confirms that they want complete sign in |
| + // with default sync settings. |
| + void HandleConfirm(const base::ListValue* args); |
| + |
| + // Handles "undo" message from the page. No arguments. |
| + // This message is sent when the user clicks "undo" on the sync confirmation |
| + // dialog, which aborts signin and prevents sync from starting. |
| + void HandleUndo(const base::ListValue* args); |
| + |
| + // Handles "initialized" message from the page. No arguments. |
| + // This message is sent when the sync confirmation dialog is finished being |
| + // initialized. |
| + void HandleInitialized(const base::ListValue* args); |
| + |
| + // Handles "goToSettings" message from the page. No arguments. |
| + // This message is sent when the user clicks on the "Settings" link in the |
| + // sync confirmation dialog, which completes sign in but takes the user to the |
| + // sync settings page for configuration before starting sync. |
| + void HandleGoToSettings(const base::ListValue* args); |
| + |
| + // Sets the profile picture shown in the dialog to the image at |url| |
|
Dan Beam
2016/01/13 23:45:22
nit: end with .
anthonyvd
2016/01/18 21:40:08
Done.
|
| + void SetUserImageURL(const std::string& url); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SyncConfirmationHandler); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_SYNC_CONFIRMATION_HANDLER_H_ |