Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/service/cloud_print/printer_job_handler.h

Issue 12208089: Changing CloudPrintURLFetcher instantiation to be more testable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_PRINTER_JOB_HANDLER_H_ 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_
6 #define CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ 6 #define CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 virtual void OnPrinterDeleted() OVERRIDE; 138 virtual void OnPrinterDeleted() OVERRIDE;
139 virtual void OnPrinterChanged() OVERRIDE; 139 virtual void OnPrinterChanged() OVERRIDE;
140 virtual void OnJobChanged() OVERRIDE; 140 virtual void OnJobChanged() OVERRIDE;
141 141
142 // JobSpoolerDelegate implementation. 142 // JobSpoolerDelegate implementation.
143 // Called on print_thread_. 143 // Called on print_thread_.
144 virtual void OnJobSpoolSucceeded(const PlatformJobId& job_id) OVERRIDE; 144 virtual void OnJobSpoolSucceeded(const PlatformJobId& job_id) OVERRIDE;
145 virtual void OnJobSpoolFailed() OVERRIDE; 145 virtual void OnJobSpoolFailed() OVERRIDE;
146 146
147 // End Delegate implementations 147 // End Delegate implementations
148 148 protected:
149 virtual ~PrinterJobHandler();
150 virtual CloudPrintURLFetcher* CreateCloudPrintURLFetcher();
Vitaly Buka (NO REVIEWS) 2013/02/08 22:38:56 empty line before private
149 private: 151 private:
150 friend class base::RefCountedThreadSafe<PrinterJobHandler>; 152 friend class base::RefCountedThreadSafe<PrinterJobHandler>;
151 153
152 enum PrintJobError { 154 enum PrintJobError {
153 SUCCESS, 155 SUCCESS,
154 JOB_DOWNLOAD_FAILED, 156 JOB_DOWNLOAD_FAILED,
155 INVALID_JOB_DATA, 157 INVALID_JOB_DATA,
156 PRINT_FAILED, 158 PRINT_FAILED,
157 }; 159 };
158 160
(...skipping 15 matching lines...) Expand all
174 void Clear(); 176 void Clear();
175 177
176 std::string job_id_; 178 std::string job_id_;
177 std::string job_title_; 179 std::string job_title_;
178 std::string print_ticket_; 180 std::string print_ticket_;
179 FilePath print_data_file_path_; 181 FilePath print_data_file_path_;
180 std::string print_data_mime_type_; 182 std::string print_data_mime_type_;
181 std::vector<std::string> tags_; 183 std::vector<std::string> tags_;
182 }; 184 };
183 185
184 virtual ~PrinterJobHandler(); 186
185 187
186 // Begin request handlers for each state in the state machine 188 // Begin request handlers for each state in the state machine
187 CloudPrintURLFetcher::ResponseAction HandlePrinterUpdateResponse( 189 CloudPrintURLFetcher::ResponseAction HandlePrinterUpdateResponse(
188 const net::URLFetcher* source, 190 const net::URLFetcher* source,
189 const GURL& url, 191 const GURL& url,
190 base::DictionaryValue* json_data, 192 base::DictionaryValue* json_data,
191 bool succeeded); 193 bool succeeded);
192 194
193 CloudPrintURLFetcher::ResponseAction HandleJobMetadataResponse( 195 CloudPrintURLFetcher::ResponseAction HandleJobMetadataResponse(
194 const net::URLFetcher* source, 196 const net::URLFetcher* source,
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 308
307 // This typedef is to workaround the issue with certain versions of 309 // This typedef is to workaround the issue with certain versions of
308 // Visual Studio where it gets confused between multiple Delegate 310 // Visual Studio where it gets confused between multiple Delegate
309 // classes and gives a C2500 error. (I saw this error on the try bots - 311 // classes and gives a C2500 error. (I saw this error on the try bots -
310 // the workaround was not needed for my machine). 312 // the workaround was not needed for my machine).
311 typedef PrinterJobHandler::Delegate PrinterJobHandlerDelegate; 313 typedef PrinterJobHandler::Delegate PrinterJobHandlerDelegate;
312 314
313 } // namespace cloud_print 315 } // namespace cloud_print
314 316
315 #endif // CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ 317 #endif // CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/service/cloud_print/printer_job_handler.cc » ('j') | chrome/service/cloud_print/printer_job_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698