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

Side by Side Diff: chrome/browser/printing/print_view_manager_base.cc

Issue 2063863002: Use DCHECKs when observing only a single notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/printing/print_view_manager_base.h" 5 #include "chrome/browser/printing/print_view_manager_base.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 OnShowInvalidPrinterSettingsError) 233 OnShowInvalidPrinterSettingsError)
234 IPC_MESSAGE_UNHANDLED(handled = false) 234 IPC_MESSAGE_UNHANDLED(handled = false)
235 IPC_END_MESSAGE_MAP() 235 IPC_END_MESSAGE_MAP()
236 return handled || PrintManager::OnMessageReceived(message); 236 return handled || PrintManager::OnMessageReceived(message);
237 } 237 }
238 238
239 void PrintViewManagerBase::Observe( 239 void PrintViewManagerBase::Observe(
240 int type, 240 int type,
241 const content::NotificationSource& source, 241 const content::NotificationSource& source,
242 const content::NotificationDetails& details) { 242 const content::NotificationDetails& details) {
243 switch (type) { 243 DCHECK_EQ(chrome::NOTIFICATION_PRINT_JOB_EVENT, type);
244 case chrome::NOTIFICATION_PRINT_JOB_EVENT: { 244 OnNotifyPrintJobEvent(*content::Details<JobEventDetails>(details).ptr());
245 OnNotifyPrintJobEvent(*content::Details<JobEventDetails>(details).ptr());
246 break;
247 }
248 default: {
249 NOTREACHED();
250 break;
251 }
252 }
253 } 245 }
254 246
255 void PrintViewManagerBase::OnNotifyPrintJobEvent( 247 void PrintViewManagerBase::OnNotifyPrintJobEvent(
256 const JobEventDetails& event_details) { 248 const JobEventDetails& event_details) {
257 switch (event_details.type()) { 249 switch (event_details.type()) {
258 case JobEventDetails::FAILED: { 250 case JobEventDetails::FAILED: {
259 TerminatePrintJob(true); 251 TerminatePrintJob(true);
260 252
261 content::NotificationService::current()->Notify( 253 content::NotificationService::current()->Notify(
262 chrome::NOTIFICATION_PRINT_JOB_RELEASED, 254 chrome::NOTIFICATION_PRINT_JOB_RELEASED,
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 scoped_refptr<PrinterQuery> printer_query; 520 scoped_refptr<PrinterQuery> printer_query;
529 printer_query = queue_->PopPrinterQuery(cookie); 521 printer_query = queue_->PopPrinterQuery(cookie);
530 if (!printer_query.get()) 522 if (!printer_query.get())
531 return; 523 return;
532 BrowserThread::PostTask( 524 BrowserThread::PostTask(
533 BrowserThread::IO, FROM_HERE, 525 BrowserThread::IO, FROM_HERE,
534 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); 526 base::Bind(&PrinterQuery::StopWorker, printer_query.get()));
535 } 527 }
536 528
537 } // namespace printing 529 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_job_manager.cc ('k') | chrome/browser/profiles/profile_shortcut_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698