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

Unified Diff: chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_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: Remove view_tester files and don't return WeakPtrs. 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_view_bridge.h
diff --git a/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.h b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..02ff9cf3370c6fbcec5c9f35a87ce08aa5fb5b99
--- /dev/null
+++ b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.h
@@ -0,0 +1,64 @@
+// 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_VIEW_BRIDGE_H_
+#define CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_VIEW_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 CardUnmaskPromptViewCocoa;
+
+namespace autofill {
+
+class CardUnmaskPromptViewBridge : public CardUnmaskPromptView,
+ public ConstrainedWindowMacDelegate {
+ public:
+ explicit CardUnmaskPromptViewBridge(CardUnmaskPromptController* controller);
+ ~CardUnmaskPromptViewBridge() override;
+
+ // CardUnmaskPromptView implementation:
+ void ControllerGone() override;
+ void DisableAndWaitForVerification() override;
+ void GotVerificationResult(bool success) override;
+
+ // ConstrainedWindowMacDelegate implementation:
+ void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override;
+
+ void PerformClose();
+
+ private:
+ scoped_ptr<ConstrainedWindowMac> constrained_window_;
+ base::scoped_nsobject<CardUnmaskPromptViewCocoa> sheet_controller_;
+
+ // The controller |this| queries for logic and state.
+ CardUnmaskPromptController* controller_;
+};
+
+} // autofill
+
+@interface CardUnmaskPromptViewCocoa : NSWindowController<NSWindowDelegate> {
+ @private
+ content::WebContents* webContents_;
+
+ // Owns |self|.
+ autofill::CardUnmaskPromptViewBridge* bridge_;
+}
+
+// Designated initializer. |webContents| and |bridge| must not be NULL.
+- (id)initWithWebContents:(content::WebContents*)webContents
+ bridge:(autofill::CardUnmaskPromptViewBridge*)bridge;
+
+// Closes the sheet and ends the modal loop.
+- (IBAction)closeSheet:(id)sender;
+
+@end
+
+#endif // CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698