Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Side by Side Diff: chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.h

Issue 929293005: Autofill: Add contents of CVC unmask prompt dialog on OSX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cup_01_initial_add
Patch Set: Address groby@ comments for patch set 1. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
groby-ooo-7-16 2015/02/28 00:49:17 Why include this?
bondd 2015/03/02 23:04:04 Done.
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> {
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_;
53 } 55 }
54 56
55 // Designated initializer. |webContents| and |bridge| must not be NULL. 57 // Designated initializer. |webContents| and |bridge| must not be NULL.
56 - (id)initWithWebContents:(content::WebContents*)webContents 58 - (id)initWithWebContents:(content::WebContents*)webContents
57 bridge:(autofill::CardUnmaskPromptViewBridge*)bridge; 59 bridge:(autofill::CardUnmaskPromptViewBridge*)bridge;
58 60
59 // Closes the sheet and ends the modal loop. 61 // Closes the sheet and ends the modal loop.
60 - (IBAction)closeSheet:(id)sender; 62 - (IBAction)closeSheet:(id)sender;
61 63
62 @end 64 @end
63 65
64 #endif // CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ 66 #endif // CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698