Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_COCOA_H_ | |
| 6 #define CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_COCOA_H_ | |
| 7 | |
| 8 #include "base/mac/scoped_nsobject.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "chrome/browser/ui/autofill/card_unmask_prompt_view.h" | |
| 11 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" | |
| 12 | |
| 13 namespace content { | |
| 14 class NavigationController; | |
| 15 } | |
| 16 | |
| 17 @class CardUnmaskPromptWindowController; | |
| 18 @class GTMWidthBasedTweaker; | |
| 19 | |
| 20 namespace autofill { | |
| 21 | |
| 22 class CardUnmaskPromptCocoa : public CardUnmaskPromptView, | |
| 23 public ConstrainedWindowMacDelegate { | |
| 24 public: | |
| 25 explicit CardUnmaskPromptCocoa(CardUnmaskPromptController* controller); | |
| 26 ~CardUnmaskPromptCocoa() override; | |
| 27 | |
| 28 // CardUnmaskPromptView implementation: | |
| 29 void ControllerGone() override; | |
| 30 void DisableAndWaitForVerification() override; | |
| 31 void GotVerificationResult(bool success) override; | |
| 32 | |
| 33 // ConstrainedWindowMacDelegate implementation: | |
| 34 void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override; | |
| 35 | |
| 36 void PerformClose(); | |
| 37 | |
| 38 private: | |
| 39 scoped_ptr<ConstrainedWindowMac> constrained_window_; | |
| 40 base::scoped_nsobject<CardUnmaskPromptWindowController> sheet_controller_; | |
| 41 | |
| 42 // The controller |this| queries for logic and state. | |
| 43 CardUnmaskPromptController* controller_; | |
| 44 }; | |
| 45 | |
| 46 } // autofill | |
| 47 | |
| 48 @interface CardUnmaskPromptWindowController : NSWindowController | |
| 49 <NSWindowDelegate> { | |
|
groby-ooo-7-16
2015/02/06 03:06:18
That's odd formatting - git cl format?
bondd
2015/02/09 19:21:00
Done. Applied 'git cl format' to entire CL.
| |
| 50 @private | |
| 51 content::WebContents* webContents_; // weak. | |
| 52 autofill::CardUnmaskPromptCocoa* cardUnmaskPrompt_; // weak. | |
|
groby-ooo-7-16
2015/02/06 03:06:18
I'd suggest calling it cardUnmaskPromptBridge_ sin
bondd
2015/02/09 19:21:00
Done.
| |
| 53 | |
| 54 base::scoped_nsobject<GTMWidthBasedTweaker> buttonContainer_; | |
|
groby-ooo-7-16
2015/02/06 03:06:18
Do you need a tweaker?
bondd
2015/02/09 19:21:00
This is the same way AutofillMainContainer does it
groby-ooo-7-16
2015/02/09 20:25:02
It is, but by now I consider it overkill for just
bondd
2015/02/09 23:07:32
Done. I understand what you mean now. Changed it t
| |
| 55 } | |
| 56 | |
| 57 // Designated initializer. The WebContents cannot be NULL. | |
|
groby-ooo-7-16
2015/02/06 03:06:18
|webContents| cannot...
bondd
2015/02/09 19:21:00
Done.
| |
| 58 - (id)initWithWebContents:(content::WebContents*)webContents | |
| 59 cardUnmaskPrompt:(autofill::CardUnmaskPromptCocoa*)cardUnmaskPrompt; | |
|
groby-ooo-7-16
2015/02/06 03:06:18
Align ":"
bondd
2015/02/09 19:21:00
Done.
| |
| 60 | |
| 61 // Closes the sheet and ends the modal loop. This will also clean up the memory. | |
|
groby-ooo-7-16
2015/02/06 03:06:18
Which memory?
bondd
2015/02/09 19:21:00
Done.
| |
| 62 - (IBAction)closeSheet:(id)sender; | |
| 63 | |
| 64 @end | |
| 65 | |
| 66 #endif // CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_COCOA_H_ | |
| OLD | NEW |