OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // Reports a diagnostic message to the server. | 114 // Reports a diagnostic message to the server. |
115 void ReportUserMessage(const std::string& message_id, | 115 void ReportUserMessage(const std::string& message_id, |
116 const std::string& failure_message); | 116 const std::string& failure_message); |
117 | 117 |
118 bool RemovePrinterFromList(const std::string& printer_name, | 118 bool RemovePrinterFromList(const std::string& printer_name, |
119 printing::PrinterList* printer_list); | 119 printing::PrinterList* printer_list); |
120 | 120 |
121 void InitJobHandlerForPrinter(DictionaryValue* printer_data); | 121 void InitJobHandlerForPrinter(DictionaryValue* printer_data); |
122 | 122 |
123 enum PendingTaskType { | 123 enum PendingTaskType { |
| 124 PENDING_PRINTERS_NONE, |
124 PENDING_PRINTERS_AVAILABLE, | 125 PENDING_PRINTERS_AVAILABLE, |
125 PENDING_PRINTER_REGISTER, | 126 PENDING_PRINTER_REGISTER, |
126 PENDING_PRINTER_DELETE | 127 PENDING_PRINTER_DELETE |
127 }; | 128 }; |
128 | 129 |
129 // TODO(jhawkins): This name conflicts with base::PendingTask. | 130 // TODO(jhawkins): This name conflicts with base::PendingTask. |
130 struct PendingTask { | 131 struct PendingTask { |
131 PendingTaskType type; | 132 PendingTaskType type; |
132 // Optional members, depending on type. | 133 // Optional members, depending on type. |
133 std::string printer_id; // For pending delete. | 134 std::string printer_id; // For pending delete. |
134 printing::PrinterBasicInfo printer_info; // For pending registration. | 135 printing::PrinterBasicInfo printer_info; // For pending registration. |
135 | 136 |
136 PendingTask() {} | 137 PendingTask() : type(PENDING_PRINTERS_NONE) {} |
137 ~PendingTask() {} | 138 ~PendingTask() {} |
138 }; | 139 }; |
139 | 140 |
140 void AddPendingAvailableTask(); | 141 void AddPendingAvailableTask(); |
141 void AddPendingDeleteTask(const std::string& id); | 142 void AddPendingDeleteTask(const std::string& id); |
142 void AddPendingRegisterTask(const printing::PrinterBasicInfo& info); | 143 void AddPendingRegisterTask(const printing::PrinterBasicInfo& info); |
143 void AddPendingTask(const PendingTask& task); | 144 void AddPendingTask(const PendingTask& task); |
144 void ProcessPendingTask(); | 145 void ProcessPendingTask(); |
145 void ContinuePendingTaskProcessing(); | 146 void ContinuePendingTaskProcessing(); |
146 void OnPrintersAvailable(); | 147 void OnPrintersAvailable(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // The CloudPrintURLFetcher instance for the current request. | 179 // The CloudPrintURLFetcher instance for the current request. |
179 scoped_refptr<CloudPrintURLFetcher> request_; | 180 scoped_refptr<CloudPrintURLFetcher> request_; |
180 // The CloudPrintURLFetcher instance for the user message request. | 181 // The CloudPrintURLFetcher instance for the user message request. |
181 scoped_refptr<CloudPrintURLFetcher> user_message_request_; | 182 scoped_refptr<CloudPrintURLFetcher> user_message_request_; |
182 | 183 |
183 DISALLOW_COPY_AND_ASSIGN(CloudPrintConnector); | 184 DISALLOW_COPY_AND_ASSIGN(CloudPrintConnector); |
184 }; | 185 }; |
185 | 186 |
186 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_CONNECTOR_H_ | 187 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_CONNECTOR_H_ |
187 | 188 |
OLD | NEW |