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

Unified Diff: ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.h

Issue 2586993002: Upstream Chrome on iOS source code [3/11]. (Closed)
Patch Set: Created 4 years 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/autofill/card_unmask_prompt_view_bridge.h
diff --git a/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.h b/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..7f55a97bdc50ccb09d236ab7deaea24e40bdc04c
--- /dev/null
+++ b/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.h
@@ -0,0 +1,81 @@
+// 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 IOS_CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_
+#define IOS_CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_
+
+#include "base/mac/scoped_nsobject.h"
+#include "base/memory/weak_ptr.h"
+#include "base/strings/string16.h"
+#include "components/autofill/core/browser/ui/card_unmask_prompt_view.h"
+#import "ios/chrome/browser/ui/collection_view/collection_view_controller.h"
+
+@class CardUnmaskPromptViewIOS;
+
+namespace autofill {
+
+class CardUnmaskPromptController;
+
+// iOS implementation of the unmask prompt UI.
+class CardUnmaskPromptViewBridge : public CardUnmaskPromptView {
+ public:
+ explicit CardUnmaskPromptViewBridge(CardUnmaskPromptController* controller);
+ ~CardUnmaskPromptViewBridge() override;
+
+ // CardUnmaskPromptView:
+ void Show() override;
+ void ControllerGone() override;
+ void DisableAndWaitForVerification() override;
+ void GotVerificationResult(const base::string16& error_message,
+ bool allow_retry) override;
+
+ CardUnmaskPromptController* GetController();
+
+ // Closes the view.
+ void PerformClose();
+
+ // Deletes self. This should only be called by CardUnmaskPromptViewIOS after
+ // it finishes dismissing its own UI elements.
+ void DeleteSelf();
+
+ private:
+ base::scoped_nsobject<CardUnmaskPromptViewIOS> view_;
+
+ // The controller |this| queries for logic and state.
+ CardUnmaskPromptController* controller_; // weak
+
+ base::WeakPtrFactory<CardUnmaskPromptViewBridge> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViewBridge);
+};
+
+} // namespace autofill
+
+@interface CardUnmaskPromptViewIOS : CollectionViewController
+
+// Designated initializer. |bridge| must not be null.
+- (instancetype)initWithBridge:(autofill::CardUnmaskPromptViewBridge*)bridge
+ NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithStyle:(CollectionViewControllerStyle)style
+ NS_UNAVAILABLE;
+
+// Shows the form that allows the user to input their CVC.
+- (void)showCVCInputForm;
+
+// Shows the form that allows the user to input their CVC along with the
+// supplied error message.
+- (void)showCVCInputFormWithError:(NSString*)errorMessage;
+
+// Shows a progress spinner with a "verifying" message.
+- (void)showSpinner;
+
+// Shows a checkmark image and a "success" message.
+- (void)showSuccess;
+
+// Shows an error image and the provided message.
+- (void)showError:(NSString*)errorMessage;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698