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_; | |
51 // 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.
| |
52 autofill::CardUnmaskPromptBridge* cardUnmaskPromptBridge_; | |
53 | |
54 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.
| |
55 } | |
56 | |
57 // 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.
| |
58 - (id)initWithWebContents:(content::WebContents*)webContents | |
59 bridge:(autofill::CardUnmaskPromptBridge*)bridge; | |
60 | |
61 // Closes the sheet and ends the modal loop. | |
62 - (IBAction)closeSheet:(id)sender; | |
63 | |
64 @end | |
65 | |
66 #endif // CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_BRIDGE_H_ | |
OLD | NEW |