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

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

Issue 7004007: iwyu: Include stringprintf.h where appropriate, part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix 2. Created 9 years, 7 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 | Annotate | Revision Log
OLDNEW
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 #include "chrome/service/cloud_print/printer_job_handler.h" 5 #include "chrome/service/cloud_print/printer_job_handler.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/md5.h" 9 #include "base/md5.h"
10 #include "base/string_util.h" 10 #include "base/stringprintf.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "chrome/common/net/http_return.h" 13 #include "chrome/common/net/http_return.h"
14 #include "chrome/service/cloud_print/cloud_print_consts.h" 14 #include "chrome/service/cloud_print/cloud_print_consts.h"
15 #include "chrome/service/cloud_print/cloud_print_helpers.h" 15 #include "chrome/service/cloud_print/cloud_print_helpers.h"
16 #include "chrome/service/cloud_print/job_status_updater.h" 16 #include "chrome/service/cloud_print/job_status_updater.h"
17 #include "googleurl/src/gurl.h" 17 #include "googleurl/src/gurl.h"
18 #include "net/http/http_response_headers.h" 18 #include "net/http/http_response_headers.h"
19 19
20 PrinterJobHandler::JobDetails::JobDetails() {} 20 PrinterJobHandler::JobDetails::JobDetails() {}
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 mime_boundary, 235 mime_boundary,
236 std::string(), &post_data); 236 std::string(), &post_data);
237 } 237 }
238 if (printer_info.printer_description != printer_info_.printer_description) { 238 if (printer_info.printer_description != printer_info_.printer_description) {
239 CloudPrintHelpers::AddMultipartValueForUpload( 239 CloudPrintHelpers::AddMultipartValueForUpload(
240 kPrinterDescValue, printer_info.printer_description, mime_boundary, 240 kPrinterDescValue, printer_info.printer_description, mime_boundary,
241 std::string() , &post_data); 241 std::string() , &post_data);
242 } 242 }
243 if (printer_info.printer_status != printer_info_.printer_status) { 243 if (printer_info.printer_status != printer_info_.printer_status) {
244 CloudPrintHelpers::AddMultipartValueForUpload( 244 CloudPrintHelpers::AddMultipartValueForUpload(
245 kPrinterStatusValue, StringPrintf("%d", printer_info.printer_status), 245 kPrinterStatusValue,
246 mime_boundary, std::string(), &post_data); 246 base::StringPrintf("%d", printer_info.printer_status),
247 mime_boundary,
248 std::string(),
249 &post_data);
247 } 250 }
248 printer_info_ = printer_info; 251 printer_info_ = printer_info;
249 if (!post_data.empty()) { 252 if (!post_data.empty()) {
250 // Terminate the request body 253 // Terminate the request body
251 post_data.append("--" + mime_boundary + "--\r\n"); 254 post_data.append("--" + mime_boundary + "--\r\n");
252 std::string mime_type("multipart/form-data; boundary="); 255 std::string mime_type("multipart/form-data; boundary=");
253 mime_type += mime_boundary; 256 mime_type += mime_boundary;
254 SetNextJSONHandler(&PrinterJobHandler::HandlePrinterUpdateResponse); 257 SetNextJSONHandler(&PrinterJobHandler::HandlePrinterUpdateResponse);
255 request_ = new CloudPrintURLFetcher; 258 request_ = new CloudPrintURLFetcher;
256 request_->StartPostRequest( 259 request_->StartPostRequest(
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 } 673 }
671 674
672 void PrinterJobHandler::OnJobSpoolFailed() { 675 void PrinterJobHandler::OnJobSpoolFailed() {
673 DCHECK(MessageLoop::current() == print_thread_.message_loop()); 676 DCHECK(MessageLoop::current() == print_thread_.message_loop());
674 job_spooler_ = NULL; 677 job_spooler_ = NULL;
675 job_handler_message_loop_proxy_->PostTask(FROM_HERE, 678 job_handler_message_loop_proxy_->PostTask(FROM_HERE,
676 NewRunnableMethod(this, 679 NewRunnableMethod(this,
677 &PrinterJobHandler::JobFailed, 680 &PrinterJobHandler::JobFailed,
678 PRINT_FAILED)); 681 PRINT_FAILED));
679 } 682 }
OLDNEW
« no previous file with comments | « chrome/service/cloud_print/cloud_print_url_fetcher.cc ('k') | chrome/service/net/service_url_request_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698