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

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

Issue 6356007: Added a diagnostic user message when enumerating printers fails. Also tweaked... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fixed build errors Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/string_util.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 59
60 bool PrinterJobHandler::Initialize() { 60 bool PrinterJobHandler::Initialize() {
61 if (print_system_->IsValidPrinter( 61 if (print_system_->IsValidPrinter(
62 printer_info_.printer_name)) { 62 printer_info_.printer_name)) {
63 printer_watcher_ = print_system_->CreatePrinterWatcher( 63 printer_watcher_ = print_system_->CreatePrinterWatcher(
64 printer_info_.printer_name); 64 printer_info_.printer_name);
65 printer_watcher_->StartWatching(this); 65 printer_watcher_->StartWatching(this);
66 CheckForJobs(kJobFetchReasonStartup); 66 CheckForJobs(kJobFetchReasonStartup);
67 } else { 67 } else {
68 // This printer does not exist any more. Delete it from the server. 68 // This printer does not exist any more. Check if we should delete it from
69 OnPrinterDeleted(); 69 // the server.
70 if (delegate_->OnPrinterNotFound(printer_info_.printer_name))
71 OnPrinterDeleted();
70 } 72 }
71 return true; 73 return true;
72 } 74 }
73 75
74 PrinterJobHandler::~PrinterJobHandler() { 76 PrinterJobHandler::~PrinterJobHandler() {
75 if (printer_watcher_) 77 if (printer_watcher_)
76 printer_watcher_->StopWatching(); 78 printer_watcher_->StopWatching();
77 } 79 }
78 80
79 void PrinterJobHandler::Reset() { 81 void PrinterJobHandler::Reset() {
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 } 634 }
633 635
634 void PrinterJobHandler::OnJobSpoolFailed() { 636 void PrinterJobHandler::OnJobSpoolFailed() {
635 DCHECK(MessageLoop::current() == print_thread_.message_loop()); 637 DCHECK(MessageLoop::current() == print_thread_.message_loop());
636 job_spooler_ = NULL; 638 job_spooler_ = NULL;
637 job_handler_message_loop_proxy_->PostTask(FROM_HERE, 639 job_handler_message_loop_proxy_->PostTask(FROM_HERE,
638 NewRunnableMethod(this, 640 NewRunnableMethod(this,
639 &PrinterJobHandler::JobFailed, 641 &PrinterJobHandler::JobFailed,
640 PRINT_FAILED)); 642 PRINT_FAILED));
641 } 643 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698