autofill_dialog_controller.h revision d0247b1b59f9c528cb6df88b4f2b9afaf80d181e
1// Copyright 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. 4 5#ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ 6#define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ 7 8#include <string> 9 10#include "base/callback.h" 11#include "base/memory/weak_ptr.h" 12#include "base/strings/string16.h" 13#include "chrome/browser/ui/autofill/autofill_dialog_types.h" 14#include "components/autofill/core/browser/form_structure.h" 15 16class GURL; 17 18namespace content { 19class WebContents; 20} 21 22namespace user_prefs { 23class PrefRegistrySyncable; 24} 25 26namespace autofill { 27 28// This class defines the interface to the controller for TabAutofillManager. 29class AutofillDialogController { 30 public: 31 virtual ~AutofillDialogController(); 32 33 // Creates the AutofillDialogController. 34 static base::WeakPtr<AutofillDialogController> Create( 35 content::WebContents* contents, 36 const FormData& form_structure, 37 const GURL& source_url, 38 const base::Callback<void(const FormStructure*)>& callback); 39 40 // Registers profile preferences. 41 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 42 43 // Shows the Autofill dialog. 44 virtual void Show() = 0; 45 46 // Hides the Autofill dialog. 47 virtual void Hide() = 0; 48 49 // Called when the tab hosting this dialog is activated by a user gesture. 50 // Used to trigger a refresh of the user's Wallet data. 51 virtual void TabActivated() = 0; 52}; 53 54} // namespace autofill 55 56#endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ 57