| OLD | NEW |
| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 61 | 61 |
| 62 content::NotificationService::current()->Notify( | 62 content::NotificationService::current()->Notify( |
| 63 chrome::NOTIFICATION_AUTOFILL_MULTIPLE_CHANGED, | 63 chrome::NOTIFICATION_AUTOFILL_MULTIPLE_CHANGED, |
| 64 content::Source<WebDataService>(web_data_service.get()), | 64 content::Source<WebDataService>(web_data_service.get()), |
| 65 content::NotificationService::NoDetails()); | 65 content::NotificationService::NoDetails()); |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace | 68 } // namespace |
| 69 | 69 |
| 70 // static |
| 71 AutofillWebData* AutofillWebData::ForService(WebDataServiceBase* service) { |
| 72 return static_cast<WebDataService*>(service); |
| 73 } |
| 74 |
| 70 WDAppImagesResult::WDAppImagesResult() : has_all_images(false) {} | 75 WDAppImagesResult::WDAppImagesResult() : has_all_images(false) {} |
| 71 | 76 |
| 72 WDAppImagesResult::~WDAppImagesResult() {} | 77 WDAppImagesResult::~WDAppImagesResult() {} |
| 73 | 78 |
| 74 WDKeywordsResult::WDKeywordsResult() | 79 WDKeywordsResult::WDKeywordsResult() |
| 75 : default_search_provider_id(0), | 80 : default_search_provider_id(0), |
| 76 builtin_keyword_version(0), | 81 builtin_keyword_version(0), |
| 77 backup_valid(false), | 82 backup_valid(false), |
| 78 did_default_search_provider_change(false) { | 83 did_default_search_provider_change(false) { |
| 79 } | 84 } |
| 80 | 85 |
| 81 WDKeywordsResult::~WDKeywordsResult() {} | 86 WDKeywordsResult::~WDKeywordsResult() {} |
| 82 | 87 |
| 83 WebDataService::WebDataService() | 88 WebDataService::WebDataService() |
| 84 : RefcountedProfileKeyedService(BrowserThread::UI), | 89 : is_running_(false), |
| 85 is_running_(false), | |
| 86 db_(NULL), | 90 db_(NULL), |
| 87 autocomplete_syncable_service_(NULL), | 91 autocomplete_syncable_service_(NULL), |
| 88 autofill_profile_syncable_service_(NULL), | 92 autofill_profile_syncable_service_(NULL), |
| 89 failed_init_(false), | 93 failed_init_(false), |
| 90 should_commit_(false), | 94 should_commit_(false), |
| 91 next_request_handle_(1), | 95 next_request_handle_(1), |
| 92 main_loop_(MessageLoop::current()) { | 96 main_loop_(MessageLoop::current()) { |
| 93 // WebDataService requires DB thread if instantiated. | 97 // WebDataService requires DB thread if instantiated. |
| 94 // Set WebDataServiceFactory::GetInstance()->SetTestingFactory(&profile, NULL) | 98 // Set WebDataServiceFactory::GetInstance()->SetTestingFactory(&profile, NULL) |
| 95 // if you do not want to instantiate WebDataService in your test. | 99 // if you do not want to instantiate WebDataService in your test. |
| (...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1512 } | 1516 } |
| 1513 | 1517 |
| 1514 const WDTypedResult* WebDataService::WebDataRequest::GetResult() const { | 1518 const WDTypedResult* WebDataService::WebDataRequest::GetResult() const { |
| 1515 return result_; | 1519 return result_; |
| 1516 } | 1520 } |
| 1517 | 1521 |
| 1518 void WebDataService::WebDataRequest::RequestComplete() { | 1522 void WebDataService::WebDataRequest::RequestComplete() { |
| 1519 message_loop_->PostTask(FROM_HERE, Bind(&WebDataService::RequestCompleted, | 1523 message_loop_->PostTask(FROM_HERE, Bind(&WebDataService::RequestCompleted, |
| 1520 service_.get(), handle_)); | 1524 service_.get(), handle_)); |
| 1521 } | 1525 } |
| OLD | NEW |