OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
19 #include "base/memory/scoped_vector.h" | 19 #include "base/memory/scoped_vector.h" |
20 #include "base/string16.h" | 20 #include "base/string16.h" |
21 #include "base/time.h" | 21 #include "base/time.h" |
22 #include "chrome/browser/autofill/autofill_download.h" | 22 #include "chrome/browser/autofill/autofill_download.h" |
23 #include "chrome/browser/autofill/field_types.h" | 23 #include "chrome/browser/autofill/field_types.h" |
24 #include "chrome/browser/autofill/form_structure.h" | 24 #include "chrome/browser/autofill/form_structure.h" |
25 #include "content/browser/tab_contents/tab_contents_observer.h" | 25 #include "content/browser/tab_contents/tab_contents_observer.h" |
26 #include "ui/gfx/rect.h" | |
Ilya Sherman
2011/11/09 20:34:19
nit: Let's forward-declare gfx::Rect here and move
csharp
2011/11/10 18:09:32
Done.
| |
26 | 27 |
27 class AutofillExternalDelegate; | 28 class AutofillExternalDelegate; |
28 class AutofillField; | 29 class AutofillField; |
29 class AutofillProfile; | 30 class AutofillProfile; |
30 class AutofillMetrics; | 31 class AutofillMetrics; |
31 class CreditCard; | 32 class CreditCard; |
32 class PersonalDataManager; | 33 class PersonalDataManager; |
33 class PrefService; | 34 class PrefService; |
34 class RenderViewHost; | 35 class RenderViewHost; |
35 class TabContentsWrapper; | 36 class TabContentsWrapper; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 | 137 |
137 // AutofillDownloadManager::Observer: | 138 // AutofillDownloadManager::Observer: |
138 virtual void OnLoadedServerPredictions( | 139 virtual void OnLoadedServerPredictions( |
139 const std::string& response_xml) OVERRIDE; | 140 const std::string& response_xml) OVERRIDE; |
140 | 141 |
141 void OnFormsSeen(const std::vector<webkit_glue::FormData>& forms, | 142 void OnFormsSeen(const std::vector<webkit_glue::FormData>& forms, |
142 const base::TimeTicks& timestamp); | 143 const base::TimeTicks& timestamp); |
143 void OnTextFieldDidChange(const webkit_glue::FormData& form, | 144 void OnTextFieldDidChange(const webkit_glue::FormData& form, |
144 const webkit_glue::FormField& field, | 145 const webkit_glue::FormField& field, |
145 const base::TimeTicks& timestamp); | 146 const base::TimeTicks& timestamp); |
147 | |
148 // The bounding_box is a page_relative value. | |
Ilya Sherman
2011/11/09 20:34:19
nit: "bounding_box" -> "|bounding_box|"
John Grabowski
2011/11/09 22:18:34
page_relative --> page relative (is english)
csharp
2011/11/10 18:09:32
Done.
| |
146 void OnQueryFormFieldAutofill(int query_id, | 149 void OnQueryFormFieldAutofill(int query_id, |
147 const webkit_glue::FormData& form, | 150 const webkit_glue::FormData& form, |
148 const webkit_glue::FormField& field); | 151 const webkit_glue::FormField& field, |
152 const gfx::Rect& bounding_box); | |
149 void OnFillAutofillFormData(int query_id, | 153 void OnFillAutofillFormData(int query_id, |
150 const webkit_glue::FormData& form, | 154 const webkit_glue::FormData& form, |
151 const webkit_glue::FormField& field, | 155 const webkit_glue::FormField& field, |
152 int unique_id); | 156 int unique_id); |
153 void OnShowAutofillDialog(); | 157 void OnShowAutofillDialog(); |
154 void OnDidPreviewAutofillFormData(); | 158 void OnDidPreviewAutofillFormData(); |
155 void OnDidFillAutofillFormData(const base::TimeTicks& timestamp); | 159 void OnDidFillAutofillFormData(const base::TimeTicks& timestamp); |
156 void OnDidShowAutofillSuggestions(bool is_new_popup); | 160 void OnDidShowAutofillSuggestions(bool is_new_popup); |
161 void OnHideAutofillPopup(); | |
157 | 162 |
158 // Fills |host| with the RenderViewHost for this tab. | 163 // Fills |host| with the RenderViewHost for this tab. |
159 // Returns false if Autofill is disabled or if the host is unavailable. | 164 // Returns false if Autofill is disabled or if the host is unavailable. |
160 bool GetHost(const std::vector<AutofillProfile*>& profiles, | 165 bool GetHost(const std::vector<AutofillProfile*>& profiles, |
161 const std::vector<CreditCard*>& credit_cards, | 166 const std::vector<CreditCard*>& credit_cards, |
162 RenderViewHost** host) const WARN_UNUSED_RESULT; | 167 RenderViewHost** host) const WARN_UNUSED_RESULT; |
163 | 168 |
164 // Unpacks |unique_id| and fills |profile| or |credit_card| with the | 169 // Unpacks |unique_id| and fills |profile| or |credit_card| with the |
165 // appropriate data source. Returns false if the unpacked id cannot be found. | 170 // appropriate data source. Returns false if the unpacked id cannot be found. |
166 bool GetProfileOrCreditCard(int unique_id, | 171 bool GetProfileOrCreditCard(int unique_id, |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
322 TestTabContentsWithExternalDelegate); | 327 TestTabContentsWithExternalDelegate); |
323 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, | 328 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, |
324 UserHappinessFormLoadAndSubmission); | 329 UserHappinessFormLoadAndSubmission); |
325 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); | 330 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); |
326 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FormFillDuration); | 331 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FormFillDuration); |
327 | 332 |
328 DISALLOW_COPY_AND_ASSIGN(AutofillManager); | 333 DISALLOW_COPY_AND_ASSIGN(AutofillManager); |
329 }; | 334 }; |
330 | 335 |
331 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 336 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
OLD | NEW |