| 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 #include "chrome/browser/printing/print_job_manager.h" | 5 #include "chrome/browser/printing/print_job_manager.h" | 
| 6 | 6 | 
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" | 
| 8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" | 
| 9 #include "chrome/browser/printing/print_job.h" | 9 #include "chrome/browser/printing/print_job.h" | 
| 10 #include "chrome/browser/printing/printer_query.h" | 10 #include "chrome/browser/printing/printer_query.h" | 
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 83       *job = current_query; | 83       *job = current_query; | 
| 84       queued_queries_.erase(itr); | 84       queued_queries_.erase(itr); | 
| 85       DCHECK(current_query->is_valid()); | 85       DCHECK(current_query->is_valid()); | 
| 86       return; | 86       return; | 
| 87     } | 87     } | 
| 88   } | 88   } | 
| 89 } | 89 } | 
| 90 | 90 | 
| 91 // static | 91 // static | 
| 92 void PrintJobManager::RegisterPrefs(PrefService* prefs) { | 92 void PrintJobManager::RegisterPrefs(PrefService* prefs) { | 
| 93   prefs->RegisterBooleanPref(prefs::kPrintingEnabled, true); | 93   prefs->RegisterBooleanPref(prefs::kPrintingEnabled, | 
|  | 94                              true, | 
|  | 95                              false /* don't sync pref */); | 
| 94 } | 96 } | 
| 95 | 97 | 
| 96 void PrintJobManager::Observe(NotificationType type, | 98 void PrintJobManager::Observe(NotificationType type, | 
| 97                               const NotificationSource& source, | 99                               const NotificationSource& source, | 
| 98                               const NotificationDetails& details) { | 100                               const NotificationDetails& details) { | 
| 99   switch (type.value) { | 101   switch (type.value) { | 
| 100     case NotificationType::PRINT_JOB_EVENT: { | 102     case NotificationType::PRINT_JOB_EVENT: { | 
| 101       OnPrintJobEvent(Source<PrintJob>(source).ptr(), | 103       OnPrintJobEvent(Source<PrintJob>(source).ptr(), | 
| 102                       *Details<JobEventDetails>(details).ptr()); | 104                       *Details<JobEventDetails>(details).ptr()); | 
| 103       break; | 105       break; | 
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 157       break; | 159       break; | 
| 158     } | 160     } | 
| 159     default: { | 161     default: { | 
| 160       NOTREACHED(); | 162       NOTREACHED(); | 
| 161       break; | 163       break; | 
| 162     } | 164     } | 
| 163   } | 165   } | 
| 164 } | 166 } | 
| 165 | 167 | 
| 166 }  // namespace printing | 168 }  // namespace printing | 
| OLD | NEW | 
|---|