Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(573)

Unified Diff: chrome/browser/ui/webui/signin/signin_error_handler.h

Issue 2275883003: [Signin Error Dialog] (2/3) Added handlers and UI constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@error-modal-web
Patch Set: Final nit from tommycli Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/signin/signin_error_handler.h
diff --git a/chrome/browser/ui/webui/signin/signin_error_handler.h b/chrome/browser/ui/webui/signin/signin_error_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..5dec91f260c681d0c4ed2ce0e54592c81ddb983b
--- /dev/null
+++ b/chrome/browser/ui/webui/signin/signin_error_handler.h
@@ -0,0 +1,62 @@
+// 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_SIGNIN_SIGNIN_ERROR_HANDLER_H_
+#define CHROME_BROWSER_UI_WEBUI_SIGNIN_SIGNIN_ERROR_HANDLER_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "content/public/browser/web_ui_message_handler.h"
+
+class Browser;
+class ProfileAttributesEntry;
+
+namespace base {
+class ListValue;
+}
+
+class SigninErrorHandler : public content::WebUIMessageHandler {
+ public:
+ SigninErrorHandler() : duplicate_profile_entry_(nullptr) {}
+ ~SigninErrorHandler() override {}
+
+ // content::WebUIMessageHandler:
+ void RegisterMessages() override;
+
+ // Sets the existing profile entry that has the same username used for signin.
+ // This function is called when the signin error is a duplicate account error.
+ void set_duplicate_profile_entry(
+ const ProfileAttributesEntry* duplicate_profile_entry);
+
+ protected:
+ // Handles "switch" message from the page. No arguments.
+ // This message is sent when the user switches to the existing profile of the
+ // same username used for signin.
+ virtual void HandleSwitchToExistingProfile(const base::ListValue* args);
+
+ // Handles "confirm" message from the page. No arguments.
+ // This message is sent when the user acknowledges the signin error.
+ virtual void HandleConfirm(const base::ListValue* args);
+
+ // Handles "learnMore" message from the page. No arguments.
+ // This message is sent when the user clicks on the "Learn more" link in the
+ // signin error dialog, which closes the dialog and takes the user to the
+ // Chrome Help page about fixing sync problems.
+ virtual void HandleLearnMore(const base::ListValue* args);
+
+ // Handles the web ui message sent when the html content is done being laid
+ // out and it's time to resize the native view hosting it to fit. |args| is
+ // a single integer value for the height the native view should resize to.
+ virtual void HandleInitializedWithSize(const base::ListValue* args);
+
+ void CloseDialog();
+
+ private:
+ const ProfileAttributesEntry* duplicate_profile_entry_;
+
+ DISALLOW_COPY_AND_ASSIGN(SigninErrorHandler);
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_SIGNIN_ERROR_HANDLER_H_
« no previous file with comments | « chrome/browser/ui/webui/signin/login_ui_test_utils.cc ('k') | chrome/browser/ui/webui/signin/signin_error_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698