• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2010 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_AUTOFILL_AUTOFILL_DIALOG_H_
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_
7 #pragma once
8 
9 #include <vector>
10 
11 #include "chrome/browser/autofill/autofill_profile.h"
12 #include "chrome/browser/autofill/credit_card.h"
13 
14 #ifdef ANDROID
15 namespace gfx {
16 typedef void* NativeView;
17 }
18 #else
19 #include "ui/gfx/native_widget_types.h"
20 #endif
21 
22 class Profile;
23 
24 // An interface the AutoFill dialog uses to notify its clients (observers) when
25 // the user has applied changes to the AutoFill profile data.
26 class AutoFillDialogObserver {
27  public:
28   // The user has confirmed changes by clicking "Apply" or "OK".  Any of the
29   // parameters may be NULL. A NULL parameter is treated as not changing the
30   // existing data. For example, |OnAutoFillDialogApply(new_profiles, NULL)|
31   // only sets the profiles and not the credit cards.
32   virtual void OnAutoFillDialogApply(
33       std::vector<AutoFillProfile>* profiles,
34       std::vector<CreditCard>* credit_cards) = 0;
35 
36  protected:
~AutoFillDialogObserver()37   virtual ~AutoFillDialogObserver() {}
38 };
39 
40 // Shows the AutoFill dialog, which allows the user to edit profile information.
41 // |profile| is profile from which you can get vectors of autofill profiles that
42 // contains the current profile information and credit cards.  The dialog fills
43 // out the profile fields using this data.
44 //
45 // |observer| will be notified by OnAutoFillDialogAccept when the user has
46 // applied changes.  May not be NULL.
47 //
48 // The |parent| parameter (currently only used on Windows) specifies the parent
49 // view in the view hierarchy.  May be NULL on Mac and gtk.
50 void ShowAutoFillDialog(gfx::NativeView parent,
51                         AutoFillDialogObserver* observer,
52                         Profile* profile);
53 
54 #endif  // CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_
55