OLD | NEW |
---|---|
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ |
6 #define CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ | 6 #define CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ |
7 | 7 |
8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" | |
10 #include "chrome/browser/ui/autofill/card_unmask_prompt_view.h" | 11 #include "chrome/browser/ui/autofill/card_unmask_prompt_view.h" |
11 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" | 12 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 class NavigationController; | 15 class NavigationController; |
15 } | 16 } |
16 | 17 |
17 @class CardUnmaskPromptViewCocoa; | 18 @class CardUnmaskPromptViewCocoa; |
18 | 19 |
19 namespace autofill { | 20 namespace autofill { |
20 | 21 |
21 class CardUnmaskPromptViewBridge : public CardUnmaskPromptView, | 22 class CardUnmaskPromptViewBridge : public CardUnmaskPromptView, |
22 public ConstrainedWindowMacDelegate { | 23 public ConstrainedWindowMacDelegate { |
23 public: | 24 public: |
24 explicit CardUnmaskPromptViewBridge(CardUnmaskPromptController* controller); | 25 explicit CardUnmaskPromptViewBridge(CardUnmaskPromptController* controller); |
25 ~CardUnmaskPromptViewBridge() override; | 26 ~CardUnmaskPromptViewBridge() override; |
26 | 27 |
27 // CardUnmaskPromptView implementation: | 28 // CardUnmaskPromptView implementation: |
28 void ControllerGone() override; | 29 void ControllerGone() override; |
29 void DisableAndWaitForVerification() override; | 30 void DisableAndWaitForVerification() override; |
30 void GotVerificationResult(bool success) override; | 31 void GotVerificationResult(bool success) override; |
31 | 32 |
32 // ConstrainedWindowMacDelegate implementation: | 33 // ConstrainedWindowMacDelegate implementation: |
33 void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override; | 34 void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override; |
34 | 35 |
36 CardUnmaskPromptController* GetController(); | |
35 void PerformClose(); | 37 void PerformClose(); |
36 | 38 |
37 private: | 39 private: |
38 scoped_ptr<ConstrainedWindowMac> constrained_window_; | 40 scoped_ptr<ConstrainedWindowMac> constrained_window_; |
39 base::scoped_nsobject<CardUnmaskPromptViewCocoa> sheet_controller_; | 41 base::scoped_nsobject<CardUnmaskPromptViewCocoa> view_controller_; |
40 | 42 |
41 // The controller |this| queries for logic and state. | 43 // The controller |this| queries for logic and state. |
42 CardUnmaskPromptController* controller_; | 44 CardUnmaskPromptController* controller_; |
43 }; | 45 }; |
44 | 46 |
45 } // autofill | 47 } // autofill |
46 | 48 |
47 @interface CardUnmaskPromptViewCocoa : NSWindowController<NSWindowDelegate> { | 49 @interface CardUnmaskPromptViewCocoa : NSViewController<NSWindowDelegate> { |
groby-ooo-7-16
2015/02/18 19:01:18
Why is this a view controller now?
bondd
2015/02/26 01:25:08
You had previously suggested (over IM) that I shou
groby-ooo-7-16
2015/02/28 00:49:16
Ah, my apologies. In general, if reality conflicts
| |
48 @private | 50 @private |
49 content::WebContents* webContents_; | 51 content::WebContents* webContents_; |
50 | 52 |
51 // Owns |self|. | 53 // Owns |self|. |
52 autofill::CardUnmaskPromptViewBridge* bridge_; | 54 autofill::CardUnmaskPromptViewBridge* bridge_; |
55 | |
56 autofill::MonthComboboxModel month_combobox_model_; | |
groby-ooo-7-16
2015/02/18 19:01:18
Why are these members? Do they need to persist ag
bondd
2015/02/26 01:25:08
Done.
| |
57 autofill::YearComboboxModel year_combobox_model_; | |
53 } | 58 } |
54 | 59 |
55 // Designated initializer. |webContents| and |bridge| must not be NULL. | 60 // Designated initializer. |webContents| and |bridge| must not be NULL. |
56 - (id)initWithWebContents:(content::WebContents*)webContents | 61 - (id)initWithWebContents:(content::WebContents*)webContents |
57 bridge:(autofill::CardUnmaskPromptViewBridge*)bridge; | 62 bridge:(autofill::CardUnmaskPromptViewBridge*)bridge; |
58 | 63 |
59 // Closes the sheet and ends the modal loop. | 64 // Closes the sheet and ends the modal loop. |
60 - (IBAction)closeSheet:(id)sender; | 65 - (IBAction)closeSheet:(id)sender; |
61 | 66 |
62 @end | 67 @end |
63 | 68 |
64 #endif // CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ | 69 #endif // CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ |
OLD | NEW |