Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 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 // Chromium settings and storage represent user-selected preferences and | |
| 6 // information and MUST not be extracted, overwritten or modified except | |
| 7 // through Chromium defined APIs. | |
|
Peter Kasting
2014/07/07 23:20:03
Nit: This comment seems kinda random and unhelpful
Cait (Slow)
2014/07/09 15:23:16
Done.
| |
| 8 | |
| 9 #ifndef CHROME_BROWSER_WEBDATA_PASSWORD_WEB_DATA_SERVICE_WIN_H_ | |
|
Peter Kasting
2014/07/07 23:20:03
Nit: Extra space (2 places)
Cait (Slow)
2014/07/09 15:23:16
Done.
| |
| 10 #define CHROME_BROWSER_WEBDATA_PASSWORD_WEB_DATA_SERVICE_WIN_H_ | |
| 11 | |
| 12 #include <vector> | |
| 13 | |
| 14 #include "base/memory/ref_counted.h" | |
| 15 #include "base/sequenced_task_runner_helpers.h" | |
| 16 #include "components/webdata/common/web_data_results.h" | |
| 17 #include "components/webdata/common/web_data_service_base.h" | |
| 18 #include "components/webdata/common/web_data_service_consumer.h" | |
| 19 #include "components/webdata/common/web_database.h" | |
| 20 | |
| 21 class GURL; | |
| 22 struct IE7PasswordInfo; | |
| 23 class Profile; | |
| 24 class WebDatabaseService; | |
| 25 | |
| 26 namespace base { | |
| 27 class Thread; | |
| 28 } | |
| 29 | |
| 30 namespace content { | |
| 31 class BrowserContext; | |
| 32 } | |
| 33 | |
| 34 //////////////////////////////////////////////////////////////////////////////// | |
|
Peter Kasting
2014/07/07 23:20:03
Nit: The big
///////
//
//
///////
...comment f
Cait (Slow)
2014/07/09 15:23:16
Done.
| |
| 35 // | |
| 36 // PasswordWebDataService is used to access IE7/8 Password data stored in the | |
| 37 // web database. All data is retrieved and archived in an asynchronous way. | |
| 38 // | |
| 39 // All requests return a handle. The handle can be used to cancel the request. | |
|
Peter Kasting
2014/07/07 23:20:03
Nit: This information seems like it belongs, if an
Cait (Slow)
2014/07/09 15:23:16
Done.
| |
| 40 // | |
| 41 //////////////////////////////////////////////////////////////////////////////// | |
| 42 | |
| 43 class WebDataServiceConsumer; | |
| 44 | |
| 45 class PasswordWebDataService : public WebDataServiceBase { | |
| 46 public: | |
| 47 // Retrieve a WebDataService for the given context. | |
|
Peter Kasting
2014/07/07 23:20:03
Nit: Retrieves
Cait (Slow)
2014/07/09 15:23:16
Done.
| |
| 48 static scoped_refptr<PasswordWebDataService> FromBrowserContext( | |
| 49 content::BrowserContext* context); | |
| 50 | |
| 51 PasswordWebDataService(scoped_refptr<WebDatabaseService> wdbs, | |
| 52 const ProfileErrorCallback& callback); | |
| 53 | |
| 54 // Adds |info| to the list of imported passwords from ie7/ie8. | |
| 55 void AddIE7Login(const IE7PasswordInfo& info); | |
| 56 | |
| 57 // Removes |info| from the list of imported passwords from ie7/ie8. | |
| 58 void RemoveIE7Login(const IE7PasswordInfo& info); | |
| 59 | |
| 60 // Get the login matching the information in |info|. |consumer| will be | |
|
Peter Kasting
2014/07/07 23:20:03
Nit: Gets
Cait (Slow)
2014/07/09 15:23:15
Done.
| |
| 61 // notified when the request is done. The result is of type | |
| 62 // WDResult<IE7PasswordInfo>. | |
| 63 // If there is no match, the fields of the IE7PasswordInfo will be empty. | |
| 64 Handle GetIE7Login(const IE7PasswordInfo& info, | |
| 65 WebDataServiceConsumer* consumer); | |
| 66 | |
| 67 protected: | |
| 68 // For unit tests, passes a null callback. | |
| 69 PasswordWebDataService(); | |
| 70 | |
| 71 virtual ~PasswordWebDataService(); | |
| 72 | |
| 73 private: | |
| 74 ////////////////////////////////////////////////////////////////////////////// | |
|
Peter Kasting
2014/07/07 23:20:03
Nit: Similarly, I'd remove the frame here and the
Cait (Slow)
2014/07/09 15:23:16
Done.
| |
| 75 // | |
| 76 // The following methods are only invoked on the DB thread. | |
| 77 // | |
| 78 ////////////////////////////////////////////////////////////////////////////// | |
| 79 | |
| 80 WebDatabase::State AddIE7LoginImpl(const IE7PasswordInfo& info, | |
| 81 WebDatabase* db); | |
| 82 WebDatabase::State RemoveIE7LoginImpl(const IE7PasswordInfo& info, | |
| 83 WebDatabase* db); | |
| 84 scoped_ptr<WDTypedResult> GetIE7LoginImpl(const IE7PasswordInfo& info, | |
| 85 WebDatabase* db); | |
| 86 | |
| 87 DISALLOW_COPY_AND_ASSIGN(PasswordWebDataService); | |
| 88 }; | |
| 89 | |
| 90 #endif // CHROME_BROWSER_WEBDATA_PASSWORD_WEB_DATA_SERVICE_WIN_H_ | |
| OLD | NEW |