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

Unified Diff: ios/chrome/browser/ui/commands/show_signin_command.h

Issue 1124173004: [iOS] Upstream //ios/chrome/browser/ui/commands changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation Created 5 years, 7 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: ios/chrome/browser/ui/commands/show_signin_command.h
diff --git a/ios/chrome/browser/ui/commands/show_signin_command.h b/ios/chrome/browser/ui/commands/show_signin_command.h
new file mode 100644
index 0000000000000000000000000000000000000000..c8713ea6db37c015e97b1c488d6f1951f7059c56
--- /dev/null
+++ b/ios/chrome/browser/ui/commands/show_signin_command.h
@@ -0,0 +1,58 @@
+// Copyright 2014 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 IOS_CHROME_BROWSER_UI_COMMANDS_SHOW_SIGNIN_COMMAND_H_
+#define IOS_CHROME_BROWSER_UI_COMMANDS_SHOW_SIGNIN_COMMAND_H_
+
+#import <Foundation/Foundation.h>
+
+#include "ios/chrome/browser/authentication/constants.h"
+#include "ios/chrome/browser/ui/commands/generic_chrome_command.h"
+
+typedef void (^ShowSigninCommandCompletionCallback)(BOOL succeeded,
+ BOOL profileWasSwapped);
+
+enum AuthenticationOperation {
+ // Operation to cancel the current authentication operation and dismiss any
+ // UI presented by this operation.
+ AUTHENTICATION_OPERATION_DISMISS,
+
+ // Operation to start a re-authenticate operation. The user is presented with
+ // the SSOAuth re-authenticate web page.
+ AUTHENTICATION_OPERATION_REAUTHENTICATE,
+
+ // Operation to start a sign-in operation. The user is presented with the
+ // SSOAuth sign in page (SSOAuth account picker or SSOAuth sign-in web page).
+ AUTHENTICATION_OPERATION_SIGNIN,
+};
+
+// A command to perform a sign in operation.
+@interface ShowSigninCommand : GenericChromeCommand
+
+// Mark inherited initializer as unavailable to prevent calling it by mistake.
+- (instancetype)initWithTag:(NSInteger)tag NS_UNAVAILABLE;
+
+// Initializes a command to perform the specified operation with a
+// SigninInteractionController and invoke a possibly-nil callback when finished.
+- (instancetype)initWithOperation:(AuthenticationOperation)operation
+ signInSource:(SignInSource)signInSource
+ callback:(ShowSigninCommandCompletionCallback)callback
+ NS_DESIGNATED_INITIALIZER;
+
+// Initializes a ShowSigninCommand with a nil callback.
+- (instancetype)initWithOperation:(AuthenticationOperation)operation
+ signInSource:(SignInSource)signInSource;
+
+// The callback to be invoked after the operation is complete.
+@property(nonatomic, readonly) ShowSigninCommandCompletionCallback callback;
+
+// The operation to perform during the sign-in flow.
+@property(nonatomic, readonly) AuthenticationOperation operation;
+
+// The source of this authentication operation.
+@property(nonatomic, readonly) SignInSource signInSource;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_COMMANDS_SHOW_SIGNIN_COMMAND_H_
« no previous file with comments | « ios/chrome/browser/ui/commands/show_mail_composer_command.mm ('k') | ios/chrome/browser/ui/commands/show_signin_command.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698