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