Check USB device path access when prompting users to select a device.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / autofill / autofill_dialog_cocoa.h
blob250a2357f09e6ddd0478c4fc25e86b29fde635b1
1 // Copyright (c) 2013 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_AUTOFILL_AUTOFILL_DIALOG_COCOA_H_
6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_COCOA_H_
8 #include "base/mac/scoped_nsobject.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h"
11 #include "chrome/browser/ui/autofill/autofill_dialog_types.h"
12 #include "chrome/browser/ui/autofill/autofill_dialog_view.h"
13 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
14 #include "ui/gfx/geometry/size.h"
16 namespace content {
17 class NavigationController;
20 namespace autofill {
21 class AutofillDialogViewDelegate;
22 class AutofillDialogViewTesterCocoa;
25 @class AutofillDialogWindowController;
27 namespace autofill {
29 class AutofillDialogCocoa : public AutofillDialogView,
30 public ConstrainedWindowMacDelegate {
31 public:
32 explicit AutofillDialogCocoa(AutofillDialogViewDelegate* delegate);
33 ~AutofillDialogCocoa() override;
35 // AutofillDialogView implementation:
36 void Show() override;
37 void Hide() override;
38 void UpdatesStarted() override;
39 void UpdatesFinished() override;
40 void UpdateAccountChooser() override;
41 void UpdateButtonStrip() override;
42 void UpdateOverlay() override;
43 void UpdateDetailArea() override;
44 void UpdateForErrors() override;
45 void UpdateNotificationArea() override;
46 void UpdateSection(DialogSection section) override;
47 void UpdateErrorBubble() override;
48 void FillSection(DialogSection section,
49 ServerFieldType originating_type) override;
50 void GetUserInput(DialogSection section, FieldValueMap* output) override;
51 base::string16 GetCvc() override;
52 bool SaveDetailsLocally() override;
53 const content::NavigationController* ShowSignIn(const GURL& url) override;
54 void HideSignIn() override;
55 void ModelChanged() override;
56 void OnSignInResize(const gfx::Size& pref_size) override;
57 void ValidateSection(DialogSection section) override;
59 // ConstrainedWindowMacDelegate implementation:
60 void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override;
62 AutofillDialogViewDelegate* delegate() { return delegate_; }
64 // Posts a close request on the current message loop.
65 void PerformClose();
67 private:
68 friend class AutofillDialogViewTesterCocoa;
70 // Closes the sheet and ends the modal loop. Triggers cleanup sequence.
71 void CloseNow();
73 scoped_ptr<ConstrainedWindowMac> constrained_window_;
74 base::scoped_nsobject<AutofillDialogWindowController> sheet_delegate_;
76 // The delegate |this| queries for logic and state.
77 AutofillDialogViewDelegate* delegate_;
79 // WeakPtrFactory for deferred close.
80 base::WeakPtrFactory<AutofillDialogCocoa> close_weak_ptr_factory_;
84 } // autofill
86 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_COCOA_H_