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

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: Address groby@ comments for patch set 7. 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..31f1fd904399e79f5438c898cddd88f7ad710b62
--- /dev/null
+++ b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_bridge.h
@@ -0,0 +1,66 @@
+// 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_;
+ // Owns |self|.
groby-ooo-7-16 2015/02/13 01:53:40 Personal nit: I like empty lines in front of comme
bondd 2015/02/13 02:37:13 Done.
+ autofill::CardUnmaskPromptBridge* cardUnmaskPromptBridge_;
+
+ base::scoped_nsobject<NSView> buttonContainer_;
groby-ooo-7-16 2015/02/13 01:53:40 No need to keep a reference to the container here
bondd 2015/02/13 02:37:13 Done.
+}
+
+// Designated initializer. |webContents| must not be NULL.
groby-ooo-7-16 2015/02/13 01:53:40 Can |bridge| be NULL?
bondd 2015/02/13 02:37:13 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