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

Unified Diff: chrome/browser/ui/cocoa/autofill/card_unmask_prompt_bridge.h

Issue 904613006: Autofill: First step toward CVC unmask prompt dialog on OSX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test. Created 5 years, 10 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/cocoa/autofill/card_unmask_prompt_bridge.h
diff --git a/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_bridge.h b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..3970fbb962f8e6444a70e4d7a87627794a8cbf26
--- /dev/null
+++ b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_bridge.h
@@ -0,0 +1,65 @@
+// Copyright (c) 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_COCOA_CARD_UNMASK_PROMPT_BRIDGE_H_
+#define CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_BRIDGE_H_
+
+#include "base/mac/scoped_nsobject.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/autofill/card_unmask_prompt_view.h"
+#include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
+
+namespace content {
+class NavigationController;
+}
+
+@class CardUnmaskPromptCocoa;
+
+namespace autofill {
+
+class CardUnmaskPromptBridge : public CardUnmaskPromptView,
+ public ConstrainedWindowMacDelegate {
+ public:
+ explicit CardUnmaskPromptBridge(CardUnmaskPromptController* controller);
+ ~CardUnmaskPromptBridge() override;
+
+ // CardUnmaskPromptView implementation:
+ void ControllerGone() override;
+ void DisableAndWaitForVerification() override;
+ void GotVerificationResult(bool success) override;
+ void CancelForTesting() override;
+
+ // ConstrainedWindowMacDelegate implementation:
+ void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override;
+
+ void PerformClose();
+
+ private:
+ scoped_ptr<ConstrainedWindowMac> constrained_window_;
+ base::scoped_nsobject<CardUnmaskPromptCocoa> sheet_controller_;
+
+ // The controller |this| queries for logic and state.
+ CardUnmaskPromptController* controller_;
+};
+
+} // autofill
+
+@interface CardUnmaskPromptCocoa : NSWindowController<NSWindowDelegate> {
+ @private
+ content::WebContents* webContents_; // weak.
groby-ooo-7-16 2015/02/12 00:51:55 nit: No need to label as weak (if it weren't, it s
bondd 2015/02/12 19:07:22 Done.
+ autofill::CardUnmaskPromptBridge* cardUnmaskPromptBridge_; // weak.
groby-ooo-7-16 2015/02/12 00:51:55 You might want to add the comment that it owns |se
bondd 2015/02/12 19:07:22 Done.
+
+ base::scoped_nsobject<NSView> buttonContainer_;
+}
+
+// Designated initializer. |webContents| cannot be NULL.
groby-ooo-7-16 2015/02/12 00:51:55 nit: must not :)
bondd 2015/02/12 19:07:22 Done.
+- (id)initWithWebContents:(content::WebContents*)webContents
+ bridge:(autofill::CardUnmaskPromptBridge*)bridge;
+
+// Closes the sheet and ends the modal loop.
+- (IBAction)closeSheet:(id)sender;
+
+@end
+
+#endif // CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698