Description was changed from ========== Query printers for autoconf info during setup. Use an IPP ...
3 years, 6 months ago
(2017-05-31 00:08:04 UTC)
#1
Description was changed from
==========
Query printers for autoconf info during setup.
Use an IPP query to establish if we can perform automatic
configuaration of the printer by setting the autoconf
field. This is determined by support for IPP 2.0+ and one
of the two PDLs PDF or PWG-Raster.
BUG=685676
==========
to
==========
Query printers for autoconf info during setup.
Use an IPP query to establish if we can perform automatic
configuaration of the printer by setting the autoconf
field. This is determined by support for IPP 2.0+ and one
of the two PDLs PDF or PWG-Raster.
BUG=685676
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
==========
Sorry about the lack of comments. I've been staring at this code for too long. ...
3 years, 6 months ago
(2017-06-01 21:50:29 UTC)
#6
Sorry about the lack of comments. I've been staring at this code for too long.
Hopefully it's grokable now.
xdai@: Please take a look. Let me know if you think getPrinterInfo should be
moved in cups_add_printer_dialog.js.
https://codereview.chromium.org/2915703002/diff/20001/chrome/browser/resource...
File chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
(right):
https://codereview.chromium.org/2915703002/diff/20001/chrome/browser/resource...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:52:
autoconf: false,
On 2017/05/31 16:58:52, Carlson wrote:
> Dunno why the printerXXX naming convention is used here, but is there a reason
> to break it?
No reason either way AFAICT. I've changed it.
https://codereview.chromium.org/2915703002/diff/20001/chrome/browser/resource...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:183:
return;
On 2017/05/31 16:58:52, Carlson wrote:
> nit:
> if () {
> x
> } else {
> y
> }
>
> seems slightly more elegant to me than
>
> if () {
> x;
> return;
> }
> y;
>
>
> you do the latter in a few places
Done.
https://codereview.chromium.org/2915703002/diff/20001/chrome/browser/resource...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:186:
// Open configuring dialog.
On 2017/05/31 16:58:52, Carlson wrote:
> Generally, better to comment why you're doing stuff like this than just
comment
> what's happening.
Done.
https://codereview.chromium.org/2915703002/diff/20001/chrome/browser/resource...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:195:
infoFailed_: function(rejected) {
On 2017/05/31 16:58:52, Carlson wrote:
> Why is rejected not used?
There's nothing useful in it at the moment. But the contract for Promise
indicates that there should be an object passed to onRejection.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Obje...https://codereview.chromium.org/2915703002/diff/20001/chrome/browser/ui/webui...
File chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc (right):
https://codereview.chromium.org/2915703002/diff/20001/chrome/browser/ui/webui...
chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc:218: // Run
the failure callback.
On 2017/05/31 16:58:52, Carlson wrote:
> I'm confused about when you do and don't run the failure callback. For the
> NOTREACHED conditions above, if you reach them, what's the effect? We'll hang
> forever waiting for the promise?
We run the failure callback for expected failures. The NOTREACHED() sections
indicate places where there's been a violation of expected calling conditions.
https://codereview.chromium.org/2915703002/diff/20001/chrome/browser/ui/webui...
chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc:233:
printer_address + "/" + printer_queue;
On 2017/05/31 16:58:52, Carlson wrote:
> I don't understand why you assemble a uri and then parse it back out again.
Is
> it so you can pull out the port? Could use some commenting
>
> Also, do you need to be paranoid about badly-formed printer_address input
making
> things like parsed.path.len -1?
It is just for the port so the whole uri doesn't need to be constructed then
deconstructed. Lengths won't be negative for any of the Components as
ParseStandardURL will attempt to extract all components. len could be 0, but it
won't be -1.
https://codereview.chromium.org/2915703002/diff/20001/chrome/browser/ui/webui...
File chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h (right):
https://codereview.chromium.org/2915703002/diff/20001/chrome/browser/ui/webui...
chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h:52: void
HandleGetPrinterInfo(const base::ListValue* args);
On 2017/05/31 16:58:52, Carlson wrote:
> Function comment
Done.
https://codereview.chromium.org/2915703002/diff/20001/chrome/browser/ui/webui...
chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h:104: void
OnPrinterInfo(const std::string& callback_id,
On 2017/05/31 16:58:52, Carlson wrote:
> Function comment please. When is this called, what is it expected to do?
Done.
xdai1
lgtm with nit https://codereview.chromium.org/2915703002/diff/100001/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js File chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js (right): https://codereview.chromium.org/2915703002/diff/100001/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js#newcode203 chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:203: if (this.newPrinter.printerProtocol == 'ipp' || Do ...
3 years, 6 months ago
(2017-06-05 17:55:55 UTC)
#7
Sorry for the delay. I've been able to revisit this. I've moved the query to ...
3 years, 6 months ago
(2017-06-07 23:55:39 UTC)
#8
Sorry for the delay. I've been able to revisit this. I've moved the query to
the configuring screen but I'm working through a bug where the dialog can't be
dismissed.
https://codereview.chromium.org/2915703002/diff/20001/chrome/browser/ui/webui...
File chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc (right):
https://codereview.chromium.org/2915703002/diff/20001/chrome/browser/ui/webui...
chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc:233:
printer_address + "/" + printer_queue;
On 2017/06/01 21:50:29, skau wrote:
> On 2017/05/31 16:58:52, Carlson wrote:
> > I don't understand why you assemble a uri and then parse it back out again.
> Is
> > it so you can pull out the port? Could use some commenting
> >
> > Also, do you need to be paranoid about badly-formed printer_address input
> making
> > things like parsed.path.len -1?
>
> It is just for the port so the whole uri doesn't need to be constructed then
> deconstructed. Lengths won't be negative for any of the Components as
> ParseStandardURL will attempt to extract all components. len could be 0, but
it
> won't be -1.
So, I was wrong. If there's no scheme (aka protocol) the parsing falls over.
https://codereview.chromium.org/2915703002/diff/100001/chrome/browser/resourc...
File chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
(right):
https://codereview.chromium.org/2915703002/diff/100001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:203:
if (this.newPrinter.printerProtocol == 'ipp' ||
On 2017/06/05 17:55:55, xdai1 wrote:
> Do you need to move line 216 - 218 to here?
I've moved this query to the configuring screen instead so we get the same
behavior now.
stevenjb@: settings OWNER PTAL. The dependent CL with QueryIppPrinter should be committed tomorrow.
3 years, 6 months ago
(2017-06-08 05:00:51 UTC)
#10
stevenjb@: settings OWNER
PTAL. The dependent CL with QueryIppPrinter should be committed tomorrow.
stevenjb
https://codereview.chromium.org/2915703002/diff/160001/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js File chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js (right): https://codereview.chromium.org/2915703002/diff/160001/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js#newcode178 chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:178: // Strip a leading backslashes. It is expected that ...
3 years, 6 months ago
(2017-06-08 15:58:28 UTC)
#11
Thanks for the review. PTAL. https://codereview.chromium.org/2915703002/diff/160001/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js File chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js (right): https://codereview.chromium.org/2915703002/diff/160001/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js#newcode178 chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:178: // Strip a leading ...
3 years, 6 months ago
(2017-06-08 22:11:26 UTC)
#12
Thanks for the review. PTAL.
https://codereview.chromium.org/2915703002/diff/160001/chrome/browser/resourc...
File chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
(right):
https://codereview.chromium.org/2915703002/diff/160001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:178:
// Strip a leading backslashes. It is expected that this results in an
On 2017/06/08 15:58:28, stevenjb wrote:
> s/a leading backslashes/the leading backslash/
>
> Also, is this being done for UI presentation, or for providing input to the
> model (C++ code)? If the latter, we should really have the model just handle
it.
It's not for UI presentation. It's been moved into the model.
https://codereview.chromium.org/2915703002/diff/160001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:481:
getPrinterInfo(this.newPrinter).
On 2017/06/08 15:58:27, stevenjb wrote:
> Does getPrinterInfo ever return an error (e.g. if it can't find the printer)?
If
> so, we need to check for that and handle it in onPrinterFound_() (or in a
> wrapper function).
No. If there's an error in getPrinterInfo, we reject the promise and infoFailed
gets called.
https://codereview.chromium.org/2915703002/diff/160001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:486:
this.fire('open-manufacturer-model-dialog');
On 2017/06/08 15:58:27, stevenjb wrote:
> Looks like we do these two things in several places, maybe add a helper
method.
Done.
https://codereview.chromium.org/2915703002/diff/160001/chrome/browser/ui/webu...
File chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc (right):
https://codereview.chromium.org/2915703002/diff/160001/chrome/browser/ui/webu...
chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc:265: port =
631;
On 2017/06/08 15:58:28, stevenjb wrote:
> These constants should be defined at the top of the file in a local namespace,
> e.g. kIppSchemePort (or better yet, use already defined constants if
available).
Done.
https://codereview.chromium.org/2915703002/diff/160001/chrome/browser/ui/webu...
chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc:270:
NOTREACHED() << "Unrecognized protocol. Port was not set.";
On 2017/06/08 15:58:28, stevenjb wrote:
> nit: No typewriter spacing in strings either :)
Done.
https://codereview.chromium.org/2915703002/diff/160001/chrome/browser/ui/webu...
File chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h (right):
https://codereview.chromium.org/2915703002/diff/160001/chrome/browser/ui/webu...
chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h:56: // Handles
the callback for HandleGetPrinterInfo. |callback_id| is the
On 2017/06/08 15:58:28, stevenjb wrote:
> nit: We generally avoid using two spaces between sentences in comments.
Done.
stevenjb
lgtm
3 years, 6 months ago
(2017-06-09 21:00:06 UTC)
#13
lgtm
skau
The CQ bit was checked by skau@chromium.org
3 years, 6 months ago
(2017-06-12 18:23:28 UTC)
#14
Try jobs failed on following builders: closure_compilation on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/closure_compilation/builds/9322)
3 years, 6 months ago
(2017-06-12 18:42:44 UTC)
#18
Try jobs failed on following builders: closure_compilation on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/closure_compilation/builds/9329)
3 years, 6 months ago
(2017-06-12 21:29:07 UTC)
#23
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/405211)
3 years, 6 months ago
(2017-06-13 01:27:51 UTC)
#28
CQ is committing da patch. Bot data: {"patchset_id": 260001, "attempt_start_ts": 1497397785205060, "parent_rev": "2cd6f2dd305dee2674898b6c423ec3035330cc11", "commit_rev": "8d580f5a9aecf7a5682382b9a2eb57df0eb2cd98"}
3 years, 6 months ago
(2017-06-14 01:32:00 UTC)
#32
CQ is committing da patch.
Bot data: {"patchset_id": 260001, "attempt_start_ts": 1497397785205060,
"parent_rev": "2cd6f2dd305dee2674898b6c423ec3035330cc11", "commit_rev":
"8d580f5a9aecf7a5682382b9a2eb57df0eb2cd98"}
commit-bot: I haz the power
Description was changed from ========== Query printers for autoconf info during setup. Use an IPP ...
3 years, 6 months ago
(2017-06-14 01:32:19 UTC)
#33
Message was sent while issue was closed.
Description was changed from
==========
Query printers for autoconf info during setup.
Use an IPP query to establish if we can perform automatic
configuaration of the printer by setting the autoconf
field. This is determined by support for IPP 2.0+ and one
of the two PDLs PDF or PWG-Raster.
BUG=685676
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
==========
to
==========
Query printers for autoconf info during setup.
Use an IPP query to establish if we can perform automatic
configuaration of the printer by setting the autoconf
field. This is determined by support for IPP 2.0+ and one
of the two PDLs PDF or PWG-Raster.
BUG=685676
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Review-Url: https://codereview.chromium.org/2915703002
Cr-Commit-Position: refs/heads/master@{#479243}
Committed:
https://chromium.googlesource.com/chromium/src/+/8d580f5a9aecf7a5682382b9a2eb...
==========
commit-bot: I haz the power
Committed patchset #14 (id:260001) as https://chromium.googlesource.com/chromium/src/+/8d580f5a9aecf7a5682382b9a2eb57df0eb2cd98
3 years, 6 months ago
(2017-06-14 01:32:23 UTC)
#34
Issue 2915703002: Query printers for autoconf info during setup.
(Closed)
Created 3 years, 6 months ago by skau
Modified 3 years, 6 months ago
Reviewers: Carlson, xdai1, stevenjb
Base URL:
Comments: 31