Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: chrome/browser/webdata/web_data_service.cc

Issue 13928035: WIP Component build of autofill Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make windows compiling Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #include "chrome/browser/webdata/web_data_service.h" 5 #include "chrome/browser/webdata/web_data_service.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "chrome/browser/search_engines/template_url.h" 8 #include "chrome/browser/search_engines/template_url.h"
9 #include "chrome/browser/webdata/keyword_table.h" 9 #include "chrome/browser/webdata/keyword_table.h"
10 #include "chrome/browser/webdata/logins_table.h" 10 #include "chrome/browser/webdata/logins_table.h"
11 #include "chrome/browser/webdata/token_service_table.h" 11 #include "chrome/browser/webdata/token_service_table.h"
12 #include "chrome/browser/webdata/web_apps_table.h" 12 #include "chrome/browser/webdata/web_apps_table.h"
13 #include "chrome/browser/webdata/web_data_service_factory.h"
13 #include "chrome/browser/webdata/web_intents_table.h" 14 #include "chrome/browser/webdata/web_intents_table.h"
14 #include "chrome/common/chrome_notification_types.h" 15 #include "chrome/common/chrome_notification_types.h"
15 #include "components/webdata/common/web_database_service.h" 16 #include "components/webdata/common/web_database_service.h"
16 #include "content/public/browser/notification_details.h" 17 #include "content/public/browser/notification_details.h"
17 #include "content/public/browser/notification_service.h" 18 #include "content/public/browser/notification_service.h"
18 #include "content/public/browser/notification_source.h" 19 #include "content/public/browser/notification_source.h"
19 #include "third_party/skia/include/core/SkBitmap.h" 20 #include "third_party/skia/include/core/SkBitmap.h"
20 21
21 //////////////////////////////////////////////////////////////////////////////// 22 ////////////////////////////////////////////////////////////////////////////////
22 // 23 //
23 // WebDataService implementation. 24 // WebDataService implementation.
24 // 25 //
25 //////////////////////////////////////////////////////////////////////////////// 26 ////////////////////////////////////////////////////////////////////////////////
26 27
27 using base::Bind; 28 using base::Bind;
28 using base::Time; 29 using base::Time;
29 using content::BrowserThread; 30 using content::BrowserThread;
30 31
31 WDAppImagesResult::WDAppImagesResult() : has_all_images(false) {} 32 WDAppImagesResult::WDAppImagesResult() : has_all_images(false) {}
32 33
33 WDAppImagesResult::~WDAppImagesResult() {} 34 WDAppImagesResult::~WDAppImagesResult() {}
34 35
35 WDKeywordsResult::WDKeywordsResult() 36 WDKeywordsResult::WDKeywordsResult()
36 : default_search_provider_id(0), 37 : default_search_provider_id(0),
37 builtin_keyword_version(0) { 38 builtin_keyword_version(0) {
38 } 39 }
39 40
40 WDKeywordsResult::~WDKeywordsResult() {} 41 WDKeywordsResult::~WDKeywordsResult() {}
41 42
43 // static
44 scoped_refptr<WebDataService> WebDataService::FromBrowserContext(
45 content::BrowserContext* context) {
46 return WebDataServiceFactory::GetWebDataServiceForProfile(
47 static_cast<Profile*>(context));
48 }
49
42 WebDataService::WebDataService(scoped_refptr<WebDatabaseService> wdbs, 50 WebDataService::WebDataService(scoped_refptr<WebDatabaseService> wdbs,
43 const ProfileErrorCallback& callback) 51 const ProfileErrorCallback& callback)
44 : WebDataServiceBase(wdbs, callback) { 52 : WebDataServiceBase(wdbs, callback) {
45 } 53 }
46 54
47 ////////////////////////////////////////////////////////////////////////////// 55 //////////////////////////////////////////////////////////////////////////////
48 // 56 //
49 // Keywords. 57 // Keywords.
50 // 58 //
51 ////////////////////////////////////////////////////////////////////////////// 59 //////////////////////////////////////////////////////////////////////////////
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 } 266 }
259 return WebDatabase::COMMIT_NOT_NEEDED; 267 return WebDatabase::COMMIT_NOT_NEEDED;
260 } 268 }
261 269
262 scoped_ptr<WDTypedResult> WebDataService::GetAllTokensImpl(WebDatabase* db) { 270 scoped_ptr<WDTypedResult> WebDataService::GetAllTokensImpl(WebDatabase* db) {
263 std::map<std::string, std::string> map; 271 std::map<std::string, std::string> map;
264 TokenServiceTable::FromWebDatabase(db)->GetAllTokens(&map); 272 TokenServiceTable::FromWebDatabase(db)->GetAllTokens(&map);
265 return scoped_ptr<WDTypedResult>( 273 return scoped_ptr<WDTypedResult>(
266 new WDResult<std::map<std::string, std::string> >(TOKEN_RESULT, map)); 274 new WDResult<std::map<std::string, std::string> >(TOKEN_RESULT, map));
267 } 275 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698