Move LowerCaseEqualsASCII to base namespace
[chromium-blink-merge.git] / components / autofill / content / browser / request_autocomplete_manager.h
blob131c242905451d24cc80e3fc35c85b75c8af989a
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.
5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_REQUEST_AUTOCOMPLETE_MANAGER_H_
6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_REQUEST_AUTOCOMPLETE_MANAGER_H_
8 #include "base/callback_forward.h"
9 #include "base/memory/weak_ptr.h"
10 #include "components/autofill/core/browser/autofill_client.h"
12 class GURL;
14 namespace autofill {
16 class ContentAutofillDriver;
17 struct FormData;
18 class FormStructure;
20 // Driver for the requestAutocomplete flow.
21 class RequestAutocompleteManager {
22 public:
23 explicit RequestAutocompleteManager(ContentAutofillDriver* autofill_driver);
24 ~RequestAutocompleteManager();
26 // Requests an interactive autocomplete UI to be shown for the associated
27 // frame.
28 void OnRequestAutocomplete(const FormData& form);
30 private:
31 // Tells the renderer that the current interactive autocomplete dialog
32 // finished with the |result| saying if it was successful or not, and
33 // |form_structure| containing the filled form data. |debug_message| will
34 // be printed to the developer console.
35 void ReturnAutocompleteResult(
36 AutofillClient::RequestAutocompleteResult result,
37 const base::string16& debug_message,
38 const FormStructure* form_structure);
40 // Shows the requestAutocomplete dialog for |source_url| with data from |form|
41 // and calls |callback| once the interaction is complete.
42 void ShowRequestAutocompleteDialog(
43 const FormData& form,
44 const AutofillClient::ResultCallback& callback);
46 // The autofill driver owns and outlives |this|.
47 ContentAutofillDriver* const autofill_driver_; // weak.
49 base::WeakPtrFactory<RequestAutocompleteManager> weak_ptr_factory_;
52 } // namespace autofill
54 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_REQUEST_AUTOCOMPLETE_MANAGER_H_