OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_BRIDGE_H_ | |
6 #define CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_BRIDGE_H_ | |
7 | |
8 #include "base/mac/scoped_nsobject.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "chrome/browser/ui/autofill/card_unmask_prompt_view.h" | |
11 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" | |
12 | |
13 namespace content { | |
14 class NavigationController; | |
15 } | |
16 | |
17 @class CardUnmaskPromptCocoa; | |
18 | |
19 namespace autofill { | |
20 | |
21 class CardUnmaskPromptBridge : public CardUnmaskPromptView, | |
22 public ConstrainedWindowMacDelegate { | |
23 public: | |
24 explicit CardUnmaskPromptBridge(CardUnmaskPromptController* controller); | |
25 ~CardUnmaskPromptBridge() override; | |
26 | |
27 // CardUnmaskPromptView implementation: | |
28 void ControllerGone() override; | |
29 void DisableAndWaitForVerification() override; | |
30 void GotVerificationResult(bool success) override; | |
31 void CancelForTesting() override; | |
32 | |
33 // ConstrainedWindowMacDelegate implementation: | |
34 void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override; | |
35 | |
36 void PerformClose(); | |
37 | |
38 private: | |
39 scoped_ptr<ConstrainedWindowMac> constrained_window_; | |
40 base::scoped_nsobject<CardUnmaskPromptCocoa> sheet_controller_; | |
41 | |
42 // The controller |this| queries for logic and state. | |
43 CardUnmaskPromptController* controller_; | |
44 }; | |
45 | |
46 } // autofill | |
47 | |
48 @interface CardUnmaskPromptCocoa : NSWindowController<NSWindowDelegate> { | |
49 @private | |
50 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.
| |
51 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.
| |
52 | |
53 base::scoped_nsobject<NSView> buttonContainer_; | |
54 } | |
55 | |
56 // 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.
| |
57 - (id)initWithWebContents:(content::WebContents*)webContents | |
58 bridge:(autofill::CardUnmaskPromptBridge*)bridge; | |
59 | |
60 // Closes the sheet and ends the modal loop. | |
61 - (IBAction)closeSheet:(id)sender; | |
62 | |
63 @end | |
64 | |
65 #endif // CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_BRIDGE_H_ | |
OLD | NEW |