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