Check USB device path access when prompting users to select a device.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / autofill / card_unmask_prompt_view_bridge.h
bloba5301956cfeae561fcf3c7737adf7f9174fecab3
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.
5 #ifndef CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_
6 #define CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_
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"
13 namespace content {
14 class NavigationController;
17 @class CardUnmaskPromptViewCocoa;
19 namespace autofill {
21 class CardUnmaskPromptViewBridge : public CardUnmaskPromptView,
22 public ConstrainedWindowMacDelegate {
23 public:
24 explicit CardUnmaskPromptViewBridge(CardUnmaskPromptController* controller);
25 ~CardUnmaskPromptViewBridge() override;
27 // CardUnmaskPromptView implementation:
28 void ControllerGone() override;
29 void DisableAndWaitForVerification() override;
30 void GotVerificationResult(const base::string16& error_message,
31 bool allow_retry) override;
33 // ConstrainedWindowMacDelegate implementation:
34 void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override;
36 CardUnmaskPromptController* GetController();
37 void PerformClose();
39 private:
40 scoped_ptr<ConstrainedWindowMac> constrained_window_;
41 base::scoped_nsobject<CardUnmaskPromptViewCocoa> view_controller_;
43 // The controller |this| queries for logic and state.
44 CardUnmaskPromptController* controller_;
46 base::WeakPtrFactory<CardUnmaskPromptViewBridge> weak_ptr_factory_;
49 } // autofill
51 @interface CardUnmaskPromptViewCocoa
52 : NSViewController<NSWindowDelegate, NSTextFieldDelegate>
54 // Designated initializer. |bridge| must not be NULL.
55 - (id)initWithBridge:(autofill::CardUnmaskPromptViewBridge*)bridge;
57 - (void)setProgressOverlayText:(const base::string16&)text
58 showSpinner:(BOOL)showSpinner;
59 - (void)setRetriableErrorMessage:(const base::string16&)text;
60 - (void)setPermanentErrorMessage:(const base::string16&)text;
62 @end
64 #endif // CHROME_BROWSER_UI_COCOA_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_