Chromium Code Reviews| Index: chrome/browser/ui/cocoa/autofill/card_unmask_prompt_cocoa.h |
| diff --git a/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_cocoa.h b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_cocoa.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5d6f60eae6a671a1a2480731cb647ad9ab8089ef |
| --- /dev/null |
| +++ b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_cocoa.h |
| @@ -0,0 +1,66 @@ |
| +// Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_COCOA_H_ |
| +#define CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_COCOA_H_ |
| + |
| +#include "base/mac/scoped_nsobject.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "chrome/browser/ui/autofill/card_unmask_prompt_view.h" |
| +#include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" |
| + |
| +namespace content { |
| +class NavigationController; |
| +} |
| + |
| +@class CardUnmaskPromptWindowController; |
| +@class GTMWidthBasedTweaker; |
| + |
| +namespace autofill { |
| + |
| +class CardUnmaskPromptCocoa : public CardUnmaskPromptView, |
| + public ConstrainedWindowMacDelegate { |
| + public: |
| + explicit CardUnmaskPromptCocoa(CardUnmaskPromptController* controller); |
| + ~CardUnmaskPromptCocoa() override; |
| + |
| + // CardUnmaskPromptView implementation: |
| + void ControllerGone() override; |
| + void DisableAndWaitForVerification() override; |
| + void GotVerificationResult(bool success) override; |
| + |
| + // ConstrainedWindowMacDelegate implementation: |
| + void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override; |
| + |
| + void PerformClose(); |
| + |
| + private: |
| + scoped_ptr<ConstrainedWindowMac> constrained_window_; |
| + base::scoped_nsobject<CardUnmaskPromptWindowController> sheet_controller_; |
| + |
| + // The controller |this| queries for logic and state. |
| + CardUnmaskPromptController* controller_; |
| +}; |
| + |
| +} // autofill |
| + |
| +@interface CardUnmaskPromptWindowController : NSWindowController |
| + <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.
|
| + @private |
| + content::WebContents* webContents_; // weak. |
| + 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.
|
| + |
| + 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
|
| +} |
| + |
| +// 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.
|
| +- (id)initWithWebContents:(content::WebContents*)webContents |
| + cardUnmaskPrompt:(autofill::CardUnmaskPromptCocoa*)cardUnmaskPrompt; |
|
groby-ooo-7-16
2015/02/06 03:06:18
Align ":"
bondd
2015/02/09 19:21:00
Done.
|
| + |
| +// 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.
|
| +- (IBAction)closeSheet:(id)sender; |
| + |
| +@end |
| + |
| +#endif // CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_COCOA_H_ |