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" |
(...skipping 28 matching lines...) Expand all Loading... |
39 public: | 39 public: |
40 // ErrorType indicates which service encountered an error loading its data. | 40 // ErrorType indicates which service encountered an error loading its data. |
41 enum ErrorType { | 41 enum ErrorType { |
42 ERROR_LOADING_AUTOFILL, | 42 ERROR_LOADING_AUTOFILL, |
43 ERROR_LOADING_KEYWORD, | 43 ERROR_LOADING_KEYWORD, |
44 ERROR_LOADING_TOKEN, | 44 ERROR_LOADING_TOKEN, |
45 ERROR_LOADING_PASSWORD, | 45 ERROR_LOADING_PASSWORD, |
46 }; | 46 }; |
47 | 47 |
48 // Shows an error message if a loading error occurs. | 48 // Shows an error message if a loading error occurs. |
49 using ShowErrorCallback = void (*)(ErrorType, sql::InitStatus); | 49 // |error_type| shows which service encountered an error while loading. |
| 50 // |init_status| is the returned status of initializing the underlying |
| 51 // database. |
| 52 // |diagnostics| contains information about the underlying database |
| 53 // which can help in identifying the cause of the error. |
| 54 using ShowErrorCallback = void (*)(ErrorType error_type, |
| 55 sql::InitStatus init_status, |
| 56 const std::string& diagnostics); |
50 | 57 |
51 // Constructor for WebDataServiceWrapper that initializes the different | 58 // Constructor for WebDataServiceWrapper that initializes the different |
52 // WebDataServices and starts the synchronization services using |flare|. | 59 // WebDataServices and starts the synchronization services using |flare|. |
53 // Since |flare| will be copied and called multiple times, it cannot bind | 60 // 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 | 61 // values using base::Owned nor base::Passed; it should only bind simple or |
55 // refcounted types. | 62 // refcounted types. |
56 WebDataServiceWrapper( | 63 WebDataServiceWrapper( |
57 const base::FilePath& context_path, | 64 const base::FilePath& context_path, |
58 const std::string& application_locale, | 65 const std::string& application_locale, |
59 const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread, | 66 const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread, |
(...skipping 26 matching lines...) Expand all Loading... |
86 scoped_refptr<TokenWebData> token_web_data_; | 93 scoped_refptr<TokenWebData> token_web_data_; |
87 | 94 |
88 #if defined(OS_WIN) | 95 #if defined(OS_WIN) |
89 scoped_refptr<PasswordWebDataService> password_web_data_; | 96 scoped_refptr<PasswordWebDataService> password_web_data_; |
90 #endif | 97 #endif |
91 | 98 |
92 DISALLOW_COPY_AND_ASSIGN(WebDataServiceWrapper); | 99 DISALLOW_COPY_AND_ASSIGN(WebDataServiceWrapper); |
93 }; | 100 }; |
94 | 101 |
95 #endif // COMPONENTS_WEBDATA_SERVICES_WEB_DATA_SERVICE_WRAPPER_H_ | 102 #endif // COMPONENTS_WEBDATA_SERVICES_WEB_DATA_SERVICE_WRAPPER_H_ |
OLD | NEW |