[CUPS] Implement the UI handler for adding a new printer.
BUG=626752
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Committed: https://crrev.com/b6869005595fb70b69ad29df2c8f3fd563c2feff
Cr-Commit-Position: refs/heads/master@{#420464}
Dry run: 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/2643)
4 years, 3 months ago
(2016-09-14 04:21:21 UTC)
#5
4 years, 3 months ago
(2016-09-17 01:02:40 UTC)
#14
Dry run: This issue passed the CQ dry run.
xdai1
On 2016/09/16 23:39:50, xdai1 wrote: > michaelpg@, could you help review this CL please? Thanks! ...
4 years, 3 months ago
(2016-09-20 00:27:30 UTC)
#15
On 2016/09/16 23:39:50, xdai1 wrote:
> michaelpg@, could you help review this CL please? Thanks!
kindly ping? I guess you might not see this one. Sorry about keeping throwing
CLs to you...
michaelpg
https://codereview.chromium.org/2333283004/diff/140001/chrome/app/settings_strings.grdp File chrome/app/settings_strings.grdp (right): https://codereview.chromium.org/2333283004/diff/140001/chrome/app/settings_strings.grdp#newcode834 chrome/app/settings_strings.grdp:834: <message name="IDS_SETTINGS_PRINTING_CUPS_PRINTER_ADDED_PRINTER_MESSAGE" desc="The message shown when a new printer ...
4 years, 3 months ago
(2016-09-20 20:58:42 UTC)
#16
michaelpg@, I've addressed your comments. Please take another look, thanks! https://codereview.chromium.org/2333283004/diff/140001/chrome/app/settings_strings.grdp File chrome/app/settings_strings.grdp (right): https://codereview.chromium.org/2333283004/diff/140001/chrome/app/settings_strings.grdp#newcode834 ...
4 years, 3 months ago
(2016-09-21 17:40:20 UTC)
#17
michaelpg@, I've addressed your comments. Please take another look, thanks!
https://codereview.chromium.org/2333283004/diff/140001/chrome/app/settings_st...
File chrome/app/settings_strings.grdp (right):
https://codereview.chromium.org/2333283004/diff/140001/chrome/app/settings_st...
chrome/app/settings_strings.grdp:834: <message
name="IDS_SETTINGS_PRINTING_CUPS_PRINTER_ADDED_PRINTER_MESSAGE" desc="The
message shown when a new printer is setup successfully.">
On 2016/09/20 20:58:42, michaelpg wrote:
> nit: "set up" (2 words)
Done.
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
File chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
(right):
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:266:
this.resetPrinterData_(this.selectedPrinter);
On 2016/09/20 20:58:42, michaelpg wrote:
> This doesn't notify Polymer of these changes. How does the dialog get updated?
>
> A Polymer-y pattern might look like:
> this.selectedPrinter = this.getEmptyPrinter_();
Actually it works. For example, this.resetPrinterData_(this.newPrinter) sets
this.newPrinter.printerName to an empty string, the element in the html file
that binds to newPrinter.printerName gets notified and updates itself
immediately, right?
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:373:
if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER)
On 2016/09/20 20:58:42, michaelpg wrote:
> I'm having trouble following the flow here. When would this fail without the
> previous dialog being the manufacturer dialog? Why would that not be
considered
> a failed setup, if |success| is false?
This is the flow
https://folio.googleplex.com/chrome-ux/mocks/390-CrOS-settings-printing#%2FCU....
For manually setup flow, it's only considered as "failed" in the path:
04->04a->05->05a->05b. So on 04a, user clicks "Add" button to set up a printer,
wait for true/false response from the backend, if the backend returns false, go
to 05 and make the user specifies the maker/model and ppd file and clicks "Add"
button to retry to set up the printer, if it fails again, show 05b. So
|this.previousDialog_| could be AddPrinterDialogs.MANUALLY or
AddPrinterDialogs.MANUFACTURER, only the latter one is considered a real
failure.
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
File chrome/browser/resources/settings/printing_page/cups_printers.html (right):
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_printers.html:23: left:
150px;
On 2016/09/20 20:58:42, michaelpg wrote:
> you'll need to make this work in RTL, e.g.:
>
> .message[dir=rtl] {
> left: 0;
> right: 150px;
> }
>
> you can test with a language like Arabic
I could not test the exact string since it hasn't been translated so I used a
similar string and tested it. It looks fine to me (I made a screenshot here:
https://drive.google.com/corp/drive/u/0/folders/0B4R9nvLdzmC9d3o2WDNyNGRjejQ See
the back rectangle). Let me know if it looks good to you.
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
File
chrome/browser/resources/settings/printing_page/cups_printers_browser_proxy.js
(right):
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_printers_browser_proxy.js:50:
* @param {string} printerId
On 2016/09/20 20:58:42, michaelpg wrote:
> add param
Done.
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/ui/webu...
File chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc (right):
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/ui/webu...
chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc:189:
CallJavascriptFunction("cr.webUIListenerCallback",
On 2016/09/20 20:58:42, michaelpg wrote:
> nit: indent this and above consistently?
This is what "git cl format" gives me...
michaelpg
https://codereview.chromium.org/2333283004/diff/140001/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/2333283004/diff/140001/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js#newcode266 chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:266: this.resetPrinterData_(this.selectedPrinter); On 2016/09/21 17:40:19, xdai1 wrote: > On 2016/09/20 ...
4 years, 3 months ago
(2016-09-21 19:13:23 UTC)
#18
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
File chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
(right):
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:266:
this.resetPrinterData_(this.selectedPrinter);
On 2016/09/21 17:40:19, xdai1 wrote:
> On 2016/09/20 20:58:42, michaelpg wrote:
> > This doesn't notify Polymer of these changes. How does the dialog get
updated?
> >
> > A Polymer-y pattern might look like:
> > this.selectedPrinter = this.getEmptyPrinter_();
>
> Actually it works. For example, this.resetPrinterData_(this.newPrinter) sets
> this.newPrinter.printerName to an empty string, the element in the html file
> that binds to newPrinter.printerName gets notified and updates itself
> immediately, right?
No: https://jsfiddle.net/jdysdxey/
See https://www.polymer-project.org/1.0/docs/devguide/model-data#notify-pathhttps://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:373:
if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER)
On 2016/09/21 17:40:19, xdai1 wrote:
> On 2016/09/20 20:58:42, michaelpg wrote:
> > I'm having trouble following the flow here. When would this fail without the
> > previous dialog being the manufacturer dialog? Why would that not be
> considered
> > a failed setup, if |success| is false?
>
> This is the flow
>
https://folio.googleplex.com/chrome-ux/mocks/390-CrOS-settings-printing#%2FCU....
> For manually setup flow, it's only considered as "failed" in the path:
> 04->04a->05->05a->05b. So on 04a, user clicks "Add" button to set up a
printer,
> wait for true/false response from the backend, if the backend returns false,
go
> to 05 and make the user specifies the maker/model and ppd file and clicks
"Add"
> button to retry to set up the printer, if it fails again, show 05b. So
> |this.previousDialog_| could be AddPrinterDialogs.MANUALLY or
> AddPrinterDialogs.MANUFACTURER, only the latter one is considered a real
> failure.
Is this just because you haven't implemented the 04b error message yet?
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
File chrome/browser/resources/settings/printing_page/cups_printers.html (right):
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_printers.html:23: left:
150px;
On 2016/09/21 17:40:19, xdai1 wrote:
> On 2016/09/20 20:58:42, michaelpg wrote:
> > you'll need to make this work in RTL, e.g.:
> >
> > .message[dir=rtl] {
> > left: 0;
> > right: 150px;
> > }
> >
> > you can test with a language like Arabic
>
> I could not test the exact string since it hasn't been translated so I used a
> similar string and tested it. It looks fine to me (I made a screenshot here:
> https://drive.google.com/corp/drive/u/0/folders/0B4R9nvLdzmC9d3o2WDNyNGRjejQ
See
> the back rectangle). Let me know if it looks good to you.
So the rectangle is centered horizontally at any width (when you resize the
page)?
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/ui/webu...
File chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc (right):
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/ui/webu...
chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc:189:
CallJavascriptFunction("cr.webUIListenerCallback",
On 2016/09/21 17:40:20, xdai1 wrote:
> On 2016/09/20 20:58:42, michaelpg wrote:
> > nit: indent this and above consistently?
>
> This is what "git cl format" gives me...
Acknowledged.
https://codereview.chromium.org/2333283004/diff/180001/chrome/browser/resourc...
File chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
(right):
https://codereview.chromium.org/2333283004/diff/180001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:88:
printerPPDPath: '',
duplicate
xdai1
michealpg@, I've addressed your comments. Please take another look. thanks! https://codereview.chromium.org/2333283004/diff/140001/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/2333283004/diff/140001/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js#newcode266 ...
4 years, 3 months ago
(2016-09-21 23:16:16 UTC)
#19
michealpg@, I've addressed your comments. Please take another look. thanks!
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
File chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
(right):
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:266:
this.resetPrinterData_(this.selectedPrinter);
On 2016/09/21 19:13:23, michaelpg wrote:
> On 2016/09/21 17:40:19, xdai1 wrote:
> > On 2016/09/20 20:58:42, michaelpg wrote:
> > > This doesn't notify Polymer of these changes. How does the dialog get
> updated?
> > >
> > > A Polymer-y pattern might look like:
> > > this.selectedPrinter = this.getEmptyPrinter_();
> >
> > Actually it works. For example, this.resetPrinterData_(this.newPrinter) sets
> > this.newPrinter.printerName to an empty string, the element in the html file
> > that binds to newPrinter.printerName gets notified and updates itself
> > immediately, right?
>
> No: https://jsfiddle.net/jdysdxey/
>
> See https://www.polymer-project.org/1.0/docs/devguide/model-data#notify-path
Thanks! You're right. But then I'm confused why it does work in my case. Could
it because we only reset the printer data each time we reopen the dialog? I
modified it as you suggested.
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:373:
if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER)
On 2016/09/21 19:13:23, michaelpg wrote:
> On 2016/09/21 17:40:19, xdai1 wrote:
> > On 2016/09/20 20:58:42, michaelpg wrote:
> > > I'm having trouble following the flow here. When would this fail without
the
> > > previous dialog being the manufacturer dialog? Why would that not be
> > considered
> > > a failed setup, if |success| is false?
> >
> > This is the flow
> >
>
https://folio.googleplex.com/chrome-ux/mocks/390-CrOS-settings-printing#%2FCU....
> > For manually setup flow, it's only considered as "failed" in the path:
> > 04->04a->05->05a->05b. So on 04a, user clicks "Add" button to set up a
> printer,
> > wait for true/false response from the backend, if the backend returns false,
> go
> > to 05 and make the user specifies the maker/model and ppd file and clicks
> "Add"
> > button to retry to set up the printer, if it fails again, show 05b. So
> > |this.previousDialog_| could be AddPrinterDialogs.MANUALLY or
> > AddPrinterDialogs.MANUFACTURER, only the latter one is considered a real
> > failure.
>
> Is this just because you haven't implemented the 04b error message yet?
Actually based on the discussion I had with the PM (weifangsun@) and the backend
engineer (skau@), for now we never show img04b directly. We will always fallback
to ask the user for more info(img05) and re-try and then show the error message
if failed. I'll follow up with the PM to see if we still need the flow from
img04a->img04b.
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
File chrome/browser/resources/settings/printing_page/cups_printers.html (right):
https://codereview.chromium.org/2333283004/diff/140001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_printers.html:23: left:
150px;
On 2016/09/21 19:13:23, michaelpg wrote:
> On 2016/09/21 17:40:19, xdai1 wrote:
> > On 2016/09/20 20:58:42, michaelpg wrote:
> > > you'll need to make this work in RTL, e.g.:
> > >
> > > .message[dir=rtl] {
> > > left: 0;
> > > right: 150px;
> > > }
> > >
> > > you can test with a language like Arabic
> >
> > I could not test the exact string since it hasn't been translated so I used
a
> > similar string and tested it. It looks fine to me (I made a screenshot here:
> > https://drive.google.com/corp/drive/u/0/folders/0B4R9nvLdzmC9d3o2WDNyNGRjejQ
> See
> > the back rectangle). Let me know if it looks good to you.
>
> So the rectangle is centered horizontally at any width (when you resize the
> page)?
No, it's not... It's always centered horizontally against the full width of the
Cups print subpage.
https://codereview.chromium.org/2333283004/diff/180001/chrome/browser/resourc...
File chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
(right):
https://codereview.chromium.org/2333283004/diff/180001/chrome/browser/resourc...
chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js:88:
printerPPDPath: '',
On 2016/09/21 19:13:23, michaelpg wrote:
> duplicate
Removed it.
xdai1
michaelpg@, please take another look, thanks! https://codereview.chromium.org/2333283004/diff/220001/chrome/browser/resources/settings/printing_page/cups_printers.html File chrome/browser/resources/settings/printing_page/cups_printers.html (right): https://codereview.chromium.org/2333283004/diff/220001/chrome/browser/resources/settings/printing_page/cups_printers.html#newcode51 chrome/browser/resources/settings/printing_page/cups_printers.html:51: <div id="message"> Modified ...
4 years, 3 months ago
(2016-09-22 18:22:11 UTC)
#20
4 years, 3 months ago
(2016-09-22 21:30:48 UTC)
#25
Message was sent while issue was closed.
Committed patchset #8 (id:220001)
commit-bot: I haz the power
Description was changed from ========== [CUPS] Implement the UI handler for adding a new printer. ...
4 years, 3 months ago
(2016-09-22 21:33:20 UTC)
#26
Message was sent while issue was closed.
Description was changed from
==========
[CUPS] Implement the UI handler for adding a new printer.
BUG=626752
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
==========
to
==========
[CUPS] Implement the UI handler for adding a new printer.
BUG=626752
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Committed: https://crrev.com/b6869005595fb70b69ad29df2c8f3fd563c2feff
Cr-Commit-Position: refs/heads/master@{#420464}
==========
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/b6869005595fb70b69ad29df2c8f3fd563c2feff Cr-Commit-Position: refs/heads/master@{#420464}
4 years, 3 months ago
(2016-09-22 21:33:21 UTC)
#27
Issue 2333283004: [CUPS] Implement the UI handler for adding a new printer.
(Closed)
Created 4 years, 3 months ago by xdai1
Modified 4 years, 3 months ago
Reviewers: michaelpg
Base URL:
Comments: 22