OLD | NEW |
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 #include "chrome/service/cloud_print/print_system.h" | 5 #include "chrome/service/cloud_print/print_system.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 printer_.Close(); | 85 printer_.Close(); |
86 printer_change_.Close(); | 86 printer_change_.Close(); |
87 return true; | 87 return true; |
88 } | 88 } |
89 | 89 |
90 // base::ObjectWatcher::Delegate method | 90 // base::ObjectWatcher::Delegate method |
91 virtual void OnObjectSignaled(HANDLE object) { | 91 virtual void OnObjectSignaled(HANDLE object) { |
92 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. | 92 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. |
93 tracked_objects::ScopedTracker tracking_profile( | 93 tracked_objects::ScopedTracker tracking_profile( |
94 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 94 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
95 "PrintSystemWatcherWin_OnObjectSignaled")); | 95 "418183 PrintSystemWatcherWin::OnObjectSignaled")); |
96 | 96 |
97 crash_keys::ScopedPrinterInfo crash_key(printer_info_); | 97 crash_keys::ScopedPrinterInfo crash_key(printer_info_); |
98 DWORD change = 0; | 98 DWORD change = 0; |
99 FindNextPrinterChangeNotification(object, &change, NULL, NULL); | 99 FindNextPrinterChangeNotification(object, &change, NULL, NULL); |
100 | 100 |
101 if (change != ((PRINTER_CHANGE_PRINTER|PRINTER_CHANGE_JOB) & | 101 if (change != ((PRINTER_CHANGE_PRINTER|PRINTER_CHANGE_JOB) & |
102 (~PRINTER_CHANGE_FAILED_CONNECTION_PRINTER))) { | 102 (~PRINTER_CHANGE_FAILED_CONNECTION_PRINTER))) { |
103 // For printer connections, we get spurious change notifications with | 103 // For printer connections, we get spurious change notifications with |
104 // all flags set except PRINTER_CHANGE_FAILED_CONNECTION_PRINTER. | 104 // all flags set except PRINTER_CHANGE_FAILED_CONNECTION_PRINTER. |
105 // Ignore these. | 105 // Ignore these. |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 } | 830 } |
831 | 831 |
832 } // namespace | 832 } // namespace |
833 | 833 |
834 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( | 834 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( |
835 const base::DictionaryValue* print_system_settings) { | 835 const base::DictionaryValue* print_system_settings) { |
836 return new PrintSystemWin; | 836 return new PrintSystemWin; |
837 } | 837 } |
838 | 838 |
839 } // namespace cloud_print | 839 } // namespace cloud_print |
OLD | NEW |