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

Side by Side Diff: chrome/browser/chromeos/printer_detector/legacy_printer_detector.cc

Issue 2727633004: Change UsbDeviceFilter to use const references instead of (Closed)
Patch Set: Fix callsite missed earlier due to not building for CrOS Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 private: 223 private:
224 // UsbService::observer override: 224 // UsbService::observer override:
225 void OnDeviceAdded(scoped_refptr<device::UsbDevice> device) override { 225 void OnDeviceAdded(scoped_refptr<device::UsbDevice> device) override {
226 const user_manager::User* user = 226 const user_manager::User* user =
227 ProfileHelper::Get()->GetUserByProfile(profile_); 227 ProfileHelper::Get()->GetUserByProfile(profile_);
228 if (!user || !user->HasGaiaAccount() || !user_manager::UserManager::Get() || 228 if (!user || !user->HasGaiaAccount() || !user_manager::UserManager::Get() ||
229 user != user_manager::UserManager::Get()->GetActiveUser()) { 229 user != user_manager::UserManager::Get()->GetActiveUser()) {
230 return; 230 return;
231 } 231 }
232 232
233 if (!UsbDeviceIsPrinter(device)) { 233 if (!UsbDeviceIsPrinter(*device)) {
234 return; 234 return;
235 } 235 }
236 236
237 if (notification_ui_manager_ == nullptr) { 237 if (notification_ui_manager_ == nullptr) {
238 notification_ui_manager_ = g_browser_process->notification_ui_manager(); 238 notification_ui_manager_ = g_browser_process->notification_ui_manager();
239 } 239 }
240 240
241 UMA_HISTOGRAM_ENUMERATION("PrinterService.PrinterServiceEvent", 241 UMA_HISTOGRAM_ENUMERATION("PrinterService.PrinterServiceEvent",
242 PRINTER_ADDED, PRINTER_SERVICE_EVENT_MAX); 242 PRINTER_ADDED, PRINTER_SERVICE_EVENT_MAX);
243 ShowPrinterPluggedNotification(device); 243 ShowPrinterPluggedNotification(device);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 324
325 } // namespace 325 } // namespace
326 326
327 // static 327 // static
328 std::unique_ptr<PrinterDetector> PrinterDetector::CreateLegacy( 328 std::unique_ptr<PrinterDetector> PrinterDetector::CreateLegacy(
329 Profile* profile) { 329 Profile* profile) {
330 return base::MakeUnique<LegacyPrinterDetectorImpl>(profile); 330 return base::MakeUnique<LegacyPrinterDetectorImpl>(profile);
331 } 331 }
332 332
333 } // namespace chromeos 333 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/printer_detector/cups_printer_detector.cc ('k') | chrome/browser/chromeos/printing/usb_printer_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698