| 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/browser/chromeos/dbus/printer_service_provider.h" | 5 #include "chrome/browser/chromeos/dbus/printer_service_provider.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 } | 310 } |
| 311 | 311 |
| 312 void PrinterServiceProvider::PrinterAdded( | 312 void PrinterServiceProvider::PrinterAdded( |
| 313 dbus::MethodCall* method_call, | 313 dbus::MethodCall* method_call, |
| 314 dbus::ExportedObject::ResponseSender response_sender) { | 314 dbus::ExportedObject::ResponseSender response_sender) { |
| 315 DVLOG(1) << "PrinterAdded " << method_call->ToString(); | 315 DVLOG(1) << "PrinterAdded " << method_call->ToString(); |
| 316 dbus::MessageReader reader(method_call); | 316 dbus::MessageReader reader(method_call); |
| 317 | 317 |
| 318 std::string vendor_id; | 318 std::string vendor_id; |
| 319 reader.PopString(&vendor_id); | 319 reader.PopString(&vendor_id); |
| 320 StringToUpperASCII(&vendor_id); | 320 base::StringToUpperASCII(&vendor_id); |
| 321 | 321 |
| 322 std::string product_id; | 322 std::string product_id; |
| 323 reader.PopString(&product_id); | 323 reader.PopString(&product_id); |
| 324 StringToUpperASCII(&product_id); | 324 base::StringToUpperASCII(&product_id); |
| 325 | 325 |
| 326 // Send an empty response. | 326 // Send an empty response. |
| 327 response_sender.Run(dbus::Response::FromMethodCall(method_call)); | 327 response_sender.Run(dbus::Response::FromMethodCall(method_call)); |
| 328 | 328 |
| 329 UMA_HISTOGRAM_ENUMERATION("PrinterService.PrinterServiceEvent", PRINTER_ADDED, | 329 UMA_HISTOGRAM_ENUMERATION("PrinterService.PrinterServiceEvent", PRINTER_ADDED, |
| 330 PRINTER_SERVICE_EVENT_MAX); | 330 PRINTER_SERVICE_EVENT_MAX); |
| 331 | 331 |
| 332 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 332 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 333 switches::kEnablePrinterAppSearch)) { | 333 switches::kEnablePrinterAppSearch)) { |
| 334 return; | 334 return; |
| 335 } | 335 } |
| 336 | 336 |
| 337 ShowPrinterPluggedNotification( | 337 ShowPrinterPluggedNotification( |
| 338 notification_ui_manager_ ? notification_ui_manager_ | 338 notification_ui_manager_ ? notification_ui_manager_ |
| 339 : g_browser_process->notification_ui_manager(), | 339 : g_browser_process->notification_ui_manager(), |
| 340 vendor_id, product_id); | 340 vendor_id, product_id); |
| 341 } | 341 } |
| 342 | 342 |
| 343 } // namespace chromeos | 343 } // namespace chromeos |
| 344 | 344 |
| OLD | NEW |