blob: 64faef1f0f3ec76f47ff7c3d389dbeb5b38adaa3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
// 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_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_
#define CHROME_BROWSER_UI_COCOA_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_
#include "base/mac/scoped_nsobject.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
#include "components/autofill/core/browser/ui/card_unmask_prompt_view.h"
namespace content {
class WebContents;
}
@class CardUnmaskPromptViewCocoa;
namespace autofill {
class CardUnmaskPromptViewBridge : public CardUnmaskPromptView,
public ConstrainedWindowMacDelegate {
public:
explicit CardUnmaskPromptViewBridge(CardUnmaskPromptController* controller,
content::WebContents* web_contents);
~CardUnmaskPromptViewBridge() override;
// CardUnmaskPromptView implementation:
void Show() override;
void ControllerGone() override;
void DisableAndWaitForVerification() override;
void GotVerificationResult(const base::string16& error_message,
bool allow_retry) override;
// ConstrainedWindowMacDelegate implementation:
void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override;
CardUnmaskPromptController* GetController();
content::WebContents* GetWebContents();
void PerformClose();
private:
scoped_ptr<ConstrainedWindowMac> constrained_window_;
base::scoped_nsobject<CardUnmaskPromptViewCocoa> view_controller_;
// The controller |this| queries for logic and state.
CardUnmaskPromptController* controller_;
content::WebContents* web_contents_;
base::WeakPtrFactory<CardUnmaskPromptViewBridge> weak_ptr_factory_;
};
} // namespace autofill
@interface CardUnmaskPromptViewCocoa
: NSViewController<NSWindowDelegate, NSTextFieldDelegate>
// Designated initializer. |bridge| must not be NULL.
- (id)initWithBridge:(autofill::CardUnmaskPromptViewBridge*)bridge;
- (void)setProgressOverlayText:(const base::string16&)text
showSpinner:(BOOL)showSpinner;
- (void)setRetriableErrorMessage:(const base::string16&)text;
- (void)setPermanentErrorMessage:(const base::string16&)text;
@end
#endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_
|