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 #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_CONNECTOR_H_ | 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_CONNECTOR_H_ |
6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_CONNECTOR_H_ | 6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_CONNECTOR_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 void OnPrintersAvailable(); | 151 void OnPrintersAvailable(); |
152 void OnPrinterRegister(const printing::PrinterBasicInfo& info); | 152 void OnPrinterRegister(const printing::PrinterBasicInfo& info); |
153 void OnPrinterDelete(const std::string& name); | 153 void OnPrinterDelete(const std::string& name); |
154 | 154 |
155 void OnReceivePrinterCaps( | 155 void OnReceivePrinterCaps( |
156 bool succeeded, | 156 bool succeeded, |
157 const std::string& printer_name, | 157 const std::string& printer_name, |
158 const printing::PrinterCapsAndDefaults& caps_and_defaults); | 158 const printing::PrinterCapsAndDefaults& caps_and_defaults); |
159 | 159 |
160 bool IsSamePrinter(const std::string& name1, const std::string& name2) const; | 160 bool IsSamePrinter(const std::string& name1, const std::string& name2) const; |
| 161 bool InitPrintSystem(); |
161 | 162 |
162 // CloudPrintConnector client. | 163 // CloudPrintConnector client. |
163 Client* client_; | 164 Client* client_; |
164 // Print system settings. | 165 // Print system settings. |
165 scoped_ptr<DictionaryValue> print_system_settings_; | 166 scoped_ptr<DictionaryValue> print_system_settings_; |
166 // Pointer to current print system. | 167 // Pointer to current print system. |
167 scoped_refptr<cloud_print::PrintSystem> print_system_; | 168 scoped_refptr<cloud_print::PrintSystem> print_system_; |
168 // Watcher for print system updates. | 169 // Watcher for print system updates. |
169 scoped_refptr<cloud_print::PrintSystem::PrintServerWatcher> | 170 scoped_refptr<cloud_print::PrintSystem::PrintServerWatcher> |
170 print_server_watcher_; | 171 print_server_watcher_; |
171 // Id of the Cloud Print proxy. | 172 // Id of the Cloud Print proxy. |
172 std::string proxy_id_; | 173 std::string proxy_id_; |
173 // Cloud Print server url. | 174 // Cloud Print server url. |
174 GURL cloud_print_server_url_; | 175 GURL cloud_print_server_url_; |
175 // A map of printer id to job handler. | 176 // A map of printer id to job handler. |
176 typedef std::map<std::string, scoped_refptr<PrinterJobHandler> > | 177 typedef std::map<std::string, scoped_refptr<PrinterJobHandler> > |
177 JobHandlerMap; | 178 JobHandlerMap; |
178 JobHandlerMap job_handler_map_; | 179 JobHandlerMap job_handler_map_; |
179 // Next response handler. | 180 // Next response handler. |
180 ResponseHandler next_response_handler_; | 181 ResponseHandler next_response_handler_; |
181 // The list of peding tasks to be done in the background. | 182 // The list of pending tasks to be done in the background. |
182 std::list<PendingTask> pending_tasks_; | 183 std::list<PendingTask> pending_tasks_; |
183 // The CloudPrintURLFetcher instance for the current request. | 184 // The CloudPrintURLFetcher instance for the current request. |
184 scoped_refptr<CloudPrintURLFetcher> request_; | 185 scoped_refptr<CloudPrintURLFetcher> request_; |
185 // The CloudPrintURLFetcher instance for the user message request. | 186 // The CloudPrintURLFetcher instance for the user message request. |
186 scoped_refptr<CloudPrintURLFetcher> user_message_request_; | 187 scoped_refptr<CloudPrintURLFetcher> user_message_request_; |
187 | 188 |
188 DISALLOW_COPY_AND_ASSIGN(CloudPrintConnector); | 189 DISALLOW_COPY_AND_ASSIGN(CloudPrintConnector); |
189 }; | 190 }; |
190 | 191 |
191 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_CONNECTOR_H_ | 192 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_CONNECTOR_H_ |
192 | 193 |
OLD | NEW |