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

Issue 2738323003: Implement basic USB setup in the cups printer detector. Factor out (Closed)

Created:
3 years, 9 months ago by Carlson
Modified:
3 years, 9 months ago
Reviewers:
stevenjb, skau, tbarzic
CC:
chromium-reviews, michaelpg+watch-md-settings_chromium.org, dbeam+watch-settings_chromium.org, stevenjb+watch-md-settings_chromium.org, oshima+watch_chromium.org, davemoore+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement basic USB setup in the cups printer detector. Factor out some utility usb functions into another library (these will be reused in discovery). With this change, if you plug in a USB printer that we handle while connected to the network, it should automatically get set up. While I'm in there, rename chromeos::SetupResult to chromeos::PrinterSetupResult to prevent polluting the chromeos namespace with a relatively generic name. BUG=616866 Review-Url: https://codereview.chromium.org/2738323003 Cr-Commit-Position: refs/heads/master@{#458536} Committed: https://chromium.googlesource.com/chromium/src/+/506ac3f696915a9cf1e8da551e9f68b8a6408b45

Patch Set 1 #

Patch Set 2 : Fix lint and other minor things #

Total comments: 19

Patch Set 3 : Implement basic USB setup in the cups printer detector. Factor out some utility usb functions into… #

Total comments: 30

Patch Set 4 : Address tbarzic comments #

Patch Set 5 : Address a couple tbarzic comments I missed. #

Patch Set 6 : Remove dep on extensions #

Total comments: 16

Patch Set 7 : Address more tbarzic comments #

Patch Set 8 : Couple more tweaks. #

Patch Set 9 : More minor tweaks. #

Total comments: 18

Patch Set 10 : Implement basic USB setup in the cups printer detector. Factor out some utility usb functions into… #

Patch Set 11 : Remove failed printer tracking for now. #

Patch Set 12 : Fix ppd provider lifetime. It was being inappropriately deleted which meant it caused USB resoluti… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+353 lines, -175 lines) Patch
M chrome/browser/chromeos/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/printer_detector/cups_printer_detector.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +175 lines, -160 lines 0 comments Download
M chrome/browser/chromeos/printer_detector/legacy_printer_detector.cc View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -7 lines 0 comments Download
M chrome/browser/chromeos/printer_detector/printer_detector_factory.cc View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/printing/printer_configurer.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/printing/printer_configurer.cc View 2 chunks +2 lines, -2 lines 0 comments Download
A chrome/browser/chromeos/printing/usb_printer_util.h View 1 2 3 4 5 6 7 8 9 1 chunk +42 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/printing/usb_printer_util.cc View 1 2 3 4 5 6 7 8 9 1 chunk +120 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc View 1 chunk +4 lines, -3 lines 0 comments Download

Messages

Total messages: 32 (8 generated)
Carlson
Sean, can you take an initial pass at this?
3 years, 9 months ago (2017-03-09 23:16:44 UTC) #3
skau
generally looks good https://codereview.chromium.org/2738323003/diff/20001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc File chrome/browser/chromeos/printer_detector/cups_printer_detector.cc (right): https://codereview.chromium.org/2738323003/diff/20001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode111 chrome/browser/chromeos/printer_detector/cups_printer_detector.cc:111: if (!known_printers_.insert(device->guid()).second) { Is this a ...
3 years, 9 months ago (2017-03-11 00:00:35 UTC) #4
Carlson
PTAL? Adding tbarzic who may have opinions about what I'm doing to stuff I think ...
3 years, 9 months ago (2017-03-11 01:19:17 UTC) #6
skau
lgtm Thanks for the changes. I figured out why the encoding looks strange to me ...
3 years, 9 months ago (2017-03-13 21:56:25 UTC) #7
skau
lgtm Thanks for the changes. I figured out why the encoding looks strange to me ...
3 years, 9 months ago (2017-03-13 21:56:26 UTC) #8
skau
lgtm Thanks for the changes. I figured out why the encoding looks strange to me ...
3 years, 9 months ago (2017-03-13 21:56:28 UTC) #9
tbarzic
https://codereview.chromium.org/2738323003/diff/40001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc File chrome/browser/chromeos/printer_detector/cups_printer_detector.cc (right): https://codereview.chromium.org/2738323003/diff/40001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode82 chrome/browser/chromeos/printer_detector/cups_printer_detector.cc:82: extensions::ExtensionSystem::Get(profile)->ready().Post( Is dependency on extensions system needed? https://codereview.chromium.org/2738323003/diff/40001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode135 chrome/browser/chromeos/printer_detector/cups_printer_detector.cc:135: ...
3 years, 9 months ago (2017-03-14 01:43:33 UTC) #10
Carlson
Appreciate the ideas and review. https://codereview.chromium.org/2738323003/diff/20001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc File chrome/browser/chromeos/printer_detector/cups_printer_detector.cc (right): https://codereview.chromium.org/2738323003/diff/20001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode120 chrome/browser/chromeos/printer_detector/cups_printer_detector.cc:120: void OnDeviceAdded(scoped_refptr<device::UsbDevice> device) override ...
3 years, 9 months ago (2017-03-15 00:31:16 UTC) #11
skau
https://codereview.chromium.org/2738323003/diff/40001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc File chrome/browser/chromeos/printer_detector/cups_printer_detector.cc (right): https://codereview.chromium.org/2738323003/diff/40001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode82 chrome/browser/chromeos/printer_detector/cups_printer_detector.cc:82: extensions::ExtensionSystem::Get(profile)->ready().Post( On 2017/03/15 00:31:15, Carlson wrote: > On 2017/03/14 ...
3 years, 9 months ago (2017-03-15 04:05:53 UTC) #12
Carlson
https://codereview.chromium.org/2738323003/diff/40001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc File chrome/browser/chromeos/printer_detector/cups_printer_detector.cc (right): https://codereview.chromium.org/2738323003/diff/40001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode82 chrome/browser/chromeos/printer_detector/cups_printer_detector.cc:82: extensions::ExtensionSystem::Get(profile)->ready().Post( On 2017/03/15 04:05:53, skau wrote: > On 2017/03/15 ...
3 years, 9 months ago (2017-03-15 16:45:25 UTC) #13
tbarzic
https://codereview.chromium.org/2738323003/diff/40001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc File chrome/browser/chromeos/printer_detector/cups_printer_detector.cc (right): https://codereview.chromium.org/2738323003/diff/40001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode99 chrome/browser/chromeos/printer_detector/cups_printer_detector.cc:99: user != user_manager::UserManager::Get()->GetActiveUser()) { I don't think this is ...
3 years, 9 months ago (2017-03-15 18:43:43 UTC) #14
Carlson
https://codereview.chromium.org/2738323003/diff/40001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc File chrome/browser/chromeos/printer_detector/cups_printer_detector.cc (right): https://codereview.chromium.org/2738323003/diff/40001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode99 chrome/browser/chromeos/printer_detector/cups_printer_detector.cc:99: user != user_manager::UserManager::Get()->GetActiveUser()) { On 2017/03/15 18:43:42, tbarzic wrote: ...
3 years, 9 months ago (2017-03-15 23:06:17 UTC) #15
tbarzic
LGTM https://codereview.chromium.org/2738323003/diff/100001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc File chrome/browser/chromeos/printer_detector/cups_printer_detector.cc (right): https://codereview.chromium.org/2738323003/diff/100001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode145 chrome/browser/chromeos/printer_detector/cups_printer_detector.cc:145: data->printer = base::MakeUnique<Printer>(); On 2017/03/15 23:06:16, Carlson wrote: ...
3 years, 9 months ago (2017-03-16 04:11:29 UTC) #16
Carlson
Steven, can you look at this for OWNERS? You seem to be the lucky person ...
3 years, 9 months ago (2017-03-16 16:59:03 UTC) #18
stevenjb
https://codereview.chromium.org/2738323003/diff/160001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc File chrome/browser/chromeos/printer_detector/cups_printer_detector.cc (right): https://codereview.chromium.org/2738323003/diff/160001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode18 chrome/browser/chromeos/printer_detector/cups_printer_detector.cc:18: #include "chrome/browser/chromeos/printer_detector/printer_detector.h" nit: I don't know if our precommit ...
3 years, 9 months ago (2017-03-17 17:34:11 UTC) #19
Carlson
Thanks! PTAL? https://codereview.chromium.org/2738323003/diff/160001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc File chrome/browser/chromeos/printer_detector/cups_printer_detector.cc (right): https://codereview.chromium.org/2738323003/diff/160001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode18 chrome/browser/chromeos/printer_detector/cups_printer_detector.cc:18: #include "chrome/browser/chromeos/printer_detector/printer_detector.h" On 2017/03/17 17:34:10, stevenjb wrote: ...
3 years, 9 months ago (2017-03-17 18:47:34 UTC) #20
stevenjb
owner lgtm w/ the one comment/suggestion. https://codereview.chromium.org/2738323003/diff/160001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc File chrome/browser/chromeos/printer_detector/cups_printer_detector.cc (right): https://codereview.chromium.org/2738323003/diff/160001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode244 chrome/browser/chromeos/printer_detector/cups_printer_detector.cc:244: std::unordered_map<std::string, Printer> failed_setup_printers_; ...
3 years, 9 months ago (2017-03-17 20:49:54 UTC) #21
Carlson
https://codereview.chromium.org/2738323003/diff/160001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc File chrome/browser/chromeos/printer_detector/cups_printer_detector.cc (right): https://codereview.chromium.org/2738323003/diff/160001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode244 chrome/browser/chromeos/printer_detector/cups_printer_detector.cc:244: std::unordered_map<std::string, Printer> failed_setup_printers_; On 2017/03/17 20:49:54, stevenjb wrote: > ...
3 years, 9 months ago (2017-03-17 21:08:17 UTC) #22
stevenjb
https://codereview.chromium.org/2738323003/diff/160001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc File chrome/browser/chromeos/printer_detector/cups_printer_detector.cc (right): https://codereview.chromium.org/2738323003/diff/160001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode244 chrome/browser/chromeos/printer_detector/cups_printer_detector.cc:244: std::unordered_map<std::string, Printer> failed_setup_printers_; On 2017/03/17 21:08:17, Carlson wrote: > ...
3 years, 9 months ago (2017-03-17 21:21:13 UTC) #23
Carlson
On 2017/03/17 21:21:13, stevenjb wrote: > https://codereview.chromium.org/2738323003/diff/160001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc > File chrome/browser/chromeos/printer_detector/cups_printer_detector.cc (right): > > https://codereview.chromium.org/2738323003/diff/160001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc#newcode244 > ...
3 years, 9 months ago (2017-03-17 21:29:14 UTC) #24
stevenjb
On 2017/03/17 21:29:14, Carlson wrote: > On 2017/03/17 21:21:13, stevenjb wrote: > > > https://codereview.chromium.org/2738323003/diff/160001/chrome/browser/chromeos/printer_detector/cups_printer_detector.cc ...
3 years, 9 months ago (2017-03-17 21:30:34 UTC) #25
Carlson
On 2017/03/17 21:30:34, stevenjb wrote: > On 2017/03/17 21:29:14, Carlson wrote: > > On 2017/03/17 ...
3 years, 9 months ago (2017-03-17 21:34:35 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2738323003/220001
3 years, 9 months ago (2017-03-21 18:35:09 UTC) #29
commit-bot: I haz the power
3 years, 9 months ago (2017-03-21 20:44:35 UTC) #32
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://chromium.googlesource.com/chromium/src/+/506ac3f696915a9cf1e8da551e9f...

Powered by Google App Engine
This is Rietveld 408576698