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_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ |
6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ | 6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" | 11 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" |
11 #include "components/autofill/core/browser/ui/card_unmask_prompt_view.h" | 12 #include "components/autofill/core/browser/ui/card_unmask_prompt_view.h" |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 class WebContents; | 15 class WebContents; |
15 } | 16 } |
16 | 17 |
17 @class CardUnmaskPromptViewCocoa; | 18 @class CardUnmaskPromptViewCocoa; |
18 | 19 |
19 namespace autofill { | 20 namespace autofill { |
(...skipping 14 matching lines...) Expand all Loading... |
34 | 35 |
35 // ConstrainedWindowMacDelegate implementation: | 36 // ConstrainedWindowMacDelegate implementation: |
36 void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override; | 37 void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override; |
37 | 38 |
38 CardUnmaskPromptController* GetController(); | 39 CardUnmaskPromptController* GetController(); |
39 content::WebContents* GetWebContents(); | 40 content::WebContents* GetWebContents(); |
40 | 41 |
41 void PerformClose(); | 42 void PerformClose(); |
42 | 43 |
43 private: | 44 private: |
44 scoped_ptr<ConstrainedWindowMac> constrained_window_; | 45 std::unique_ptr<ConstrainedWindowMac> constrained_window_; |
45 base::scoped_nsobject<CardUnmaskPromptViewCocoa> view_controller_; | 46 base::scoped_nsobject<CardUnmaskPromptViewCocoa> view_controller_; |
46 | 47 |
47 // The controller |this| queries for logic and state. | 48 // The controller |this| queries for logic and state. |
48 CardUnmaskPromptController* controller_; | 49 CardUnmaskPromptController* controller_; |
49 | 50 |
50 content::WebContents* web_contents_; | 51 content::WebContents* web_contents_; |
51 base::WeakPtrFactory<CardUnmaskPromptViewBridge> weak_ptr_factory_; | 52 base::WeakPtrFactory<CardUnmaskPromptViewBridge> weak_ptr_factory_; |
52 }; | 53 }; |
53 | 54 |
54 } // namespace autofill | 55 } // namespace autofill |
55 | 56 |
56 @interface CardUnmaskPromptViewCocoa | 57 @interface CardUnmaskPromptViewCocoa |
57 : NSViewController<NSWindowDelegate, NSTextFieldDelegate> | 58 : NSViewController<NSWindowDelegate, NSTextFieldDelegate> |
58 | 59 |
59 // Designated initializer. |bridge| must not be NULL. | 60 // Designated initializer. |bridge| must not be NULL. |
60 - (id)initWithBridge:(autofill::CardUnmaskPromptViewBridge*)bridge; | 61 - (id)initWithBridge:(autofill::CardUnmaskPromptViewBridge*)bridge; |
61 | 62 |
62 - (void)setProgressOverlayText:(const base::string16&)text | 63 - (void)setProgressOverlayText:(const base::string16&)text |
63 showSpinner:(BOOL)showSpinner; | 64 showSpinner:(BOOL)showSpinner; |
64 - (void)setRetriableErrorMessage:(const base::string16&)text; | 65 - (void)setRetriableErrorMessage:(const base::string16&)text; |
65 - (void)setPermanentErrorMessage:(const base::string16&)text; | 66 - (void)setPermanentErrorMessage:(const base::string16&)text; |
66 | 67 |
67 @end | 68 @end |
68 | 69 |
69 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ | 70 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ |
OLD | NEW |