OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
15 #include "base/scoped_vector.h" | 15 #include "base/scoped_vector.h" |
16 #include "chrome/browser/autofill/autofill_dialog.h" | 16 #include "chrome/browser/autofill/autofill_dialog.h" |
17 #include "chrome/browser/autofill/autofill_download.h" | 17 #include "chrome/browser/autofill/autofill_download.h" |
18 #include "chrome/browser/autofill/personal_data_manager.h" | 18 #include "chrome/browser/autofill/personal_data_manager.h" |
19 #include "ipc/ipc_channel.h" | 19 #include "chrome/browser/tab_contents/web_navigation_observer.h" |
20 | 20 |
21 class AutoFillCCInfoBarDelegate; | 21 class AutoFillCCInfoBarDelegate; |
22 class AutoFillProfile; | 22 class AutoFillProfile; |
23 class AutoFillMetrics; | 23 class AutoFillMetrics; |
24 class CreditCard; | 24 class CreditCard; |
25 class FormStructure; | 25 class FormStructure; |
26 class PrefService; | 26 class PrefService; |
27 class RenderViewHost; | 27 class RenderViewHost; |
28 class TabContents; | |
29 | 28 |
30 namespace webkit_glue { | 29 namespace webkit_glue { |
31 struct FormData; | 30 struct FormData; |
32 class FormField; | 31 class FormField; |
33 } // namespace webkit_glue | 32 } // namespace webkit_glue |
34 | 33 |
35 // Manages saving and restoring the user's personal information entered into web | 34 // Manages saving and restoring the user's personal information entered into web |
36 // forms. | 35 // forms. |
37 class AutoFillManager : public IPC::Channel::Listener, | 36 class AutoFillManager : public WebNavigationObserver, |
38 public AutoFillDownloadManager::Observer { | 37 public AutoFillDownloadManager::Observer { |
39 public: | 38 public: |
40 explicit AutoFillManager(TabContents* tab_contents); | 39 explicit AutoFillManager(TabContents* tab_contents); |
41 virtual ~AutoFillManager(); | 40 virtual ~AutoFillManager(); |
42 | 41 |
43 // Registers our browser prefs. | 42 // Registers our browser prefs. |
44 static void RegisterBrowserPrefs(PrefService* prefs); | 43 static void RegisterBrowserPrefs(PrefService* prefs); |
45 | 44 |
46 // Registers our Enable/Disable AutoFill pref. | 45 // Registers our Enable/Disable AutoFill pref. |
47 static void RegisterUserPrefs(PrefService* prefs); | 46 static void RegisterUserPrefs(PrefService* prefs); |
48 | 47 |
49 // Returns the TabContents hosting this AutoFillManager. | 48 // Returns the TabContents hosting this AutoFillManager. |
50 TabContents* tab_contents() const { return tab_contents_; } | 49 TabContents* tab_contents() const { return tab_contents_; } |
51 | 50 |
52 // IPC::Channel::Listener implementation. | 51 // WebNavigationObserver implementation. |
| 52 virtual void DidNavigateMainFramePostCommit( |
| 53 const NavigationController::LoadCommittedDetails& details, |
| 54 const ViewHostMsg_FrameNavigate_Params& params); |
53 virtual bool OnMessageReceived(const IPC::Message& message); | 55 virtual bool OnMessageReceived(const IPC::Message& message); |
54 | 56 |
55 // Called by the AutoFillCCInfoBarDelegate when the user interacts with the | 57 // Called by the AutoFillCCInfoBarDelegate when the user interacts with the |
56 // infobar. | 58 // infobar. |
57 virtual void OnInfoBarClosed(bool should_save); | 59 virtual void OnInfoBarClosed(bool should_save); |
58 | 60 |
59 // AutoFillDownloadManager::Observer implementation: | 61 // AutoFillDownloadManager::Observer implementation: |
60 virtual void OnLoadedAutoFillHeuristics(const std::string& heuristic_xml); | 62 virtual void OnLoadedAutoFillHeuristics(const std::string& heuristic_xml); |
61 virtual void OnUploadedAutoFillHeuristics(const std::string& form_signature); | 63 virtual void OnUploadedAutoFillHeuristics(const std::string& form_signature); |
62 virtual void OnHeuristicsRequestError( | 64 virtual void OnHeuristicsRequestError( |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 FRIEND_TEST_ALL_PREFIXES(AutoFillManagerTest, FormChangesAddField); | 228 FRIEND_TEST_ALL_PREFIXES(AutoFillManagerTest, FormChangesAddField); |
227 FRIEND_TEST_ALL_PREFIXES(AutoFillMetricsTest, QualityMetrics); | 229 FRIEND_TEST_ALL_PREFIXES(AutoFillMetricsTest, QualityMetrics); |
228 FRIEND_TEST_ALL_PREFIXES(AutoFillMetricsTest, | 230 FRIEND_TEST_ALL_PREFIXES(AutoFillMetricsTest, |
229 NoQualityMetricsForNonAutoFillableForms); | 231 NoQualityMetricsForNonAutoFillableForms); |
230 FRIEND_TEST_ALL_PREFIXES(AutoFillMetricsTest, QualityMetricsForFailure); | 232 FRIEND_TEST_ALL_PREFIXES(AutoFillMetricsTest, QualityMetricsForFailure); |
231 | 233 |
232 DISALLOW_COPY_AND_ASSIGN(AutoFillManager); | 234 DISALLOW_COPY_AND_ASSIGN(AutoFillManager); |
233 }; | 235 }; |
234 | 236 |
235 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 237 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
OLD | NEW |