| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_WEBDATA_SERVICES_WEB_DATA_SERVICE_WRAPPER_H_ | 5 #ifndef COMPONENTS_WEBDATA_SERVICES_WEB_DATA_SERVICE_WRAPPER_H_ |
| 6 #define COMPONENTS_WEBDATA_SERVICES_WEB_DATA_SERVICE_WRAPPER_H_ | 6 #define COMPONENTS_WEBDATA_SERVICES_WEB_DATA_SERVICE_WRAPPER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "components/keyed_service/core/keyed_service.h" | 14 #include "components/keyed_service/core/keyed_service.h" |
| 15 #include "sql/db_diagnostic_map.h" |
| 15 #include "sql/init_status.h" | 16 #include "sql/init_status.h" |
| 16 #include "sync/api/syncable_service.h" | 17 #include "sync/api/syncable_service.h" |
| 17 | 18 |
| 18 class KeywordWebDataService; | 19 class KeywordWebDataService; |
| 19 class TokenWebData; | 20 class TokenWebData; |
| 20 class WebDatabaseService; | 21 class WebDatabaseService; |
| 21 | 22 |
| 22 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
| 23 class PasswordWebDataService; | 24 class PasswordWebDataService; |
| 24 #endif | 25 #endif |
| (...skipping 14 matching lines...) Expand all Loading... |
| 39 public: | 40 public: |
| 40 // ErrorType indicates which service encountered an error loading its data. | 41 // ErrorType indicates which service encountered an error loading its data. |
| 41 enum ErrorType { | 42 enum ErrorType { |
| 42 ERROR_LOADING_AUTOFILL, | 43 ERROR_LOADING_AUTOFILL, |
| 43 ERROR_LOADING_KEYWORD, | 44 ERROR_LOADING_KEYWORD, |
| 44 ERROR_LOADING_TOKEN, | 45 ERROR_LOADING_TOKEN, |
| 45 ERROR_LOADING_PASSWORD, | 46 ERROR_LOADING_PASSWORD, |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 // Shows an error message if a loading error occurs. | 49 // Shows an error message if a loading error occurs. |
| 49 using ShowErrorCallback = void (*)(ErrorType, sql::InitStatus); | 50 using ShowErrorCallback = void (*)(ErrorType, |
| 51 sql::InitStatus, |
| 52 const sql::DatabaseDiagnosticMap&); |
| 50 | 53 |
| 51 // Constructor for WebDataServiceWrapper that initializes the different | 54 // Constructor for WebDataServiceWrapper that initializes the different |
| 52 // WebDataServices and starts the synchronization services using |flare|. | 55 // WebDataServices and starts the synchronization services using |flare|. |
| 53 // Since |flare| will be copied and called multiple times, it cannot bind | 56 // Since |flare| will be copied and called multiple times, it cannot bind |
| 54 // values using base::Owned nor base::Passed; it should only bind simple or | 57 // values using base::Owned nor base::Passed; it should only bind simple or |
| 55 // refcounted types. | 58 // refcounted types. |
| 56 WebDataServiceWrapper( | 59 WebDataServiceWrapper( |
| 57 const base::FilePath& context_path, | 60 const base::FilePath& context_path, |
| 58 const std::string& application_locale, | 61 const std::string& application_locale, |
| 59 const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread, | 62 const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 86 scoped_refptr<TokenWebData> token_web_data_; | 89 scoped_refptr<TokenWebData> token_web_data_; |
| 87 | 90 |
| 88 #if defined(OS_WIN) | 91 #if defined(OS_WIN) |
| 89 scoped_refptr<PasswordWebDataService> password_web_data_; | 92 scoped_refptr<PasswordWebDataService> password_web_data_; |
| 90 #endif | 93 #endif |
| 91 | 94 |
| 92 DISALLOW_COPY_AND_ASSIGN(WebDataServiceWrapper); | 95 DISALLOW_COPY_AND_ASSIGN(WebDataServiceWrapper); |
| 93 }; | 96 }; |
| 94 | 97 |
| 95 #endif // COMPONENTS_WEBDATA_SERVICES_WEB_DATA_SERVICE_WRAPPER_H_ | 98 #endif // COMPONENTS_WEBDATA_SERVICES_WEB_DATA_SERVICE_WRAPPER_H_ |
| OLD | NEW |