Introduce a test which changes the paper size after the initial preview
has been prepared. Changing the paper size initiates a rerender for
the new page, and causes another call to
PrintViewManagerBase::UpdatePrintSettings(). This provides a test to
cover the Windows behavior for calling UpdatePrintableArea().
Update TestPrintBackend::GetPrinterSemanticCapsAndDefaults() so that
it sets the printable area the same way as PrintBackendWin, where any
paper size other than the default paper has a printable area that
matches the physical size.
To make the test meaningful, modify the test papers by
PrintBrowserTest::AddPrinter() so that they have a printable area which
is different than the physical size. Include matching changes to the
paper sizes used in system_access_process_print_browsertest.cc for
checking the resultant sizes in device units.
Bug: 1424368, 1432720
Change-Id: Id4ff3bc81100b6292c9dd09b5afc62badfccb479
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4429242
Reviewed-by: Andy Phan <andyphan@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1131549}
PrintViewManagerBase::UpdatePrintSettings() fails if a virtual printer
has an empty printable area. Set a default printable area for virtual
printers if the printable area is empty.
To do so, make
PrintingContext::SetDefaultPrintableAreaForVirtualPrinters() a public
method instead of protected. Create an API in PrinterQuery to set the
default printable area, and use it in PrintViewManagerBase.
Bug: 1432309
Change-Id: Iacf3f13f9e3bd69271ba10d71fafa7241edb4c65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4418637
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Alan Screen <awscreen@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1130152}
Some printer drivers provide bad printable areas, with respect to the
corresponding paper sizes. Disregard the bad values in such cases and
default to using the paper size.
Bug: 1424368
Change-Id: I31249ee28523c2ec222951a88bee882d70c7aa60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4412367
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1128423}
When getting the default printer capabilities and settings, updates in
https://crrev.com/1099645 filled in the printable area for all paper
sizes supported by a Windows driver. For some printer drivers this can
be a relatively expensive call. Since this is in an inner loop of
supported papers sizes, the performance cost is further compounded when
a printer supports many different paper sizes. This can result in
large delays in generating the Print Preview, and can make the UI
unresponsive for many seconds.
To avoid this performance impact, modify the Windows behavior for paper
printable area handling. Change getting printer capabilities to only
retrieve the printable area for the default paper size. Introduce a
new Windows-only call to PrintBackend to retrieve just the printable
area for a particular paper. Modify PrinterQuery to use this query to
update an existing PrintSettings object.
This initial version only is functional when printer calls are made
in-browser. Out-of-process printing for Windows still performs the
expensive query of retrieving the printable area for all papers. While
the UI will be responsive for OOP, it will still experience a large
delay before the preview is ready.
Bug: 879284, 1424368
Change-Id: I0b22abfb88e922a3f50fc26fd6502cdb9a01299e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4409898
Commit-Queue: Alan Screen <awscreen@chromium.org>
Reviewed-by: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1128325}
GetPrinterCapsAndDefaults() has no callers. Save the implementation in
PrintBackendWin because that one looks useful.
The PrintBackendCUPS version does have an internal caller. Simplify this
version and rename it to GetPrinterCapabilities().
Change-Id: I5475cfe01d1c5994e3937a250d4349b11c356c4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4368803
Reviewed-by: Alan Screen <awscreen@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1122029}
After https://crrev.com/1117252, UpdatePrintSettings() is no longer
called as a regular query for Print Preview. It is now only used prior
to invoking the system print dialog or at the start of printing a
document from Print Preview. This significantly changes the use case
for it, as now it can always require a context ID when it is used
out-of-process.
This change in API requires an OOP printing context to be established
earlier. It also affects StartPrinting() since the settings are now
only longer needed at this time when the system print dialog is invoked
from in the browser.
This facilitates some cleanup, since the Mojo PrintTargetType is no
longer necessary. It is now sufficient just to know if the print job
is from a system dialog.
Bug: 1414968
Change-Id: Ib5e50263df54b550216525dbd10a83e6ee3efff4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4256086
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1121921}
It is desirable for the device context which is setup in a
PrintBackendService be the same one used at the start of printing.
This requires using the same service between system print dialog
queries and document printings.
These different clients of PrintBackendServiceManager have been
registering using the printer name. This is unknown at the time
of doing a query, so these would not end up getting the same
service instance on Windows.
Change the API for system print dialog queries and document print calls
to use a client ID for how to identify the service instance to use.
This prepares for these calls to use the same service instance when
doing system dialog printing.
This requires ensuring some extra information is made available to
PrintJobWorkerOop to establish the printing context. If there could be
a system dialog invoked from the service then the parent window needs
to be known, so the GlobalRenderFrameHostId of the parent can now be
provided to the worker.
Since the service can now invoke UpdatePrintSettings() for a system
dialog from Print Preview, the assertion in TestPrintingContext
against that no longer applies. This was because it used to only
call the lower-level UpdatePrinterSettings() method.
After https://crrev.com/1117252 UpdatePrintSettings() can now be
grouped with system print dialog and document printing client types,
instead of just regular queries. Incorporating context usage for that
will be done separately in https://crrev.com/c/4256086, since it has a
significant effect on client and context management.
Bug: 1414968
Change-Id: Iebd85a131005c43c6792ec445bcb6d41fdf65cd8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4256745
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1121890}
Ideally, CupsPrinterImpl shouldn't be constructed for printers missing a
URI attribute. Hopefully, the proper fix can be implemented soon, and
this null check can be replaced with a DCHECK.
Bug: 1418564
Test: printing still works, no change in behavior
Change-Id: I8a391d1b9be602eabb5df0a6ea8973f680e23a35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4357256
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Bryan Cain <bryancain@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1120793}
When loading the printable area of a Paper, Windows needs to set
devmode->dmPaperSize to the id of the desired Paper. The list of ids may
be empty, so make sure to check it's non-empty before attempting to
access the id.
Bug: 1425784
Change-Id: Ie8e63cf15031c5ad9e79800e7fe0c94e3941c274
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4356173
Commit-Queue: Andy Phan <andyphan@chromium.org>
Reviewed-by: Alan Screen <awscreen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1119762}
For security safety we only want to process XPS object model data
outside of the browser process. Restrict the XPS print pipeline to be
used only when OOP printing is enabled.
Bug: 1008222
Change-Id: I44472030cd6d7ed111d346aaeeed90b1cd25815c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4295924
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1117872}
When a printer is selected in PrintPreview window it is queried for
properties coded in IPP attributes. All IPP attributes not supported
by PrintPreview are logged. This patch deactivate the logging of four
known unsupported IPP attributes that are reported by all CUPS
printers.
BUG=b:266573545
TEST=tested on atlas
Change-Id: I735b3078a4d41f97bebbd58f69e3abfdc27d5a55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4298054
Auto-Submit: Piotr Pawliczek <pawliczek@chromium.org>
Reviewed-by: Benjamin Gordon <bmgordon@chromium.org>
Commit-Queue: Benjamin Gordon <bmgordon@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1113773}
The network service sandbox and the print backend sandbox probably
shouldn't deliberately overlap in policy. None of the file permissions
necessary for the network service should really be necessary for the
print backend service. And, the network service syscall filter is
probably both too broad and too strict for the print backend service.
It's also best if updating one sandbox doesn't accidentally break
another.
Bug: 809738, 1079808
Change-Id: I38525b965fe6b39592d03d4ad8894be0f94edb2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4299309
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Alan Screen <awscreen@chromium.org>
Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1112567}
Follow-up on crrev.com/1094535 and enable the "strict" build config
for //printing sub-directories with separate BUILD.gn files. Fix the
existing exit time destructor by switching from std::map to
base::fixed_flat_map.
Bug: 101600
Change-Id: I88544409b7ba3fb885bdd577f4556d8946991a46
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4299980
Reviewed-by: Benjamin Gordon <bmgordon@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1112505}
This CL removes uncessary CoreFoundation.h and
base/mac/scoped_cftyperef.h header includes in
/printing/metafile.h because there is no use in the file.
Bug: 1415248
Change-Id: Ia6193bc20c1c6cfe5fbde81d26638f5fc43f97ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4290549
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1111311}
The minimum required version of GTK is 3.20 after [1] since all
supported distros have it available. However, we still have
some infra without GTK 3.20, so this CL adds a fallback codepath
for when GTK 3.20 isn't available.
This CL incidentally makes GTK an optional dependency in Chrome.
For now, the manual dependency will be kept in the deb/rpm packages.
[1] https://crrev.com/1104801
R=thestig,sky
Change-Id: I6f30b7298a13a75602b98547bdfbf9dbc6bab99b
Bug: b/270232634
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4295455
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1111248}
This CL adds PdfMetafileCgTest to printing_unittests on iOS.
The necessary test resources are packaged into the test as assets
since iOS doesn't allow access to the source root.
To perform PdfMetafileCgTest tests, printing_unittests needs
these assets under //printing/test/data/ and //pdf/test/data.
Bug: 1415248
Change-Id: Idce83b203f9453870c91066239869eae8292e34d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4258677
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1110688}
- This CL use a pattern histogram to capture a print job's success rate
based on the printer status.
- Every printer status reason variant gets its own success/fail
histogram (i.e. "PrintPreview.PrinterStatus.LowOnInk.PrintJobSuccess")
- Add the printer status to the print job settings in order to record it
to metrics.
Tests: browser_tests
Change-Id: If93803a205b6e8506a31ad43845d0775bb6ce74b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4247937
Reviewed-by: Zentaro Kavanagh <zentaro@chromium.org>
Commit-Queue: Gavin Williams <gavinwill@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1108534}
Platform implementations of PrintingContext apply PrintSettings to the
respective device contexts. Once the upper printing layers call
TakeAndResetSettings(), the PrintSettings values no longer reflect what
the printer driver's device context are set for.
Mimic this behavior by including an extra PrintSettings field in
TestPrintingContext which represents the applied settings in a
platform's device context.
Modify the TestPrintingContext callback used to notify when a new
document is called. Expand this to expose the applied settings of a
platform's device context.
Introduce a new TestPrintingContext call to allow test frameworks to
make test-specific choices for AskUserForSettings(). This allows for
extra refinement of system print dialog tests.
Update system print tests to include verification that the settings
requested from a simulated system print dialog are correctly propagated
to the start of printing. This illustrates an existing issue that the
settings are not always propagating properly.
Bug: 1414968
Change-Id: Ie8b23f390ab07d6c95ea9883e915ded9bdae4aab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4242561
Commit-Queue: Alan Screen <awscreen@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1108492}
When the DPI entry is missing, the page size, content size, and
printable area of PrintSettings will be empty. Some printers may not set
their DPI, so provide a OS-dependent default DPI.
Change-Id: Ic18cd6543801228bd18e69e3b9607c48250551d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4222980
Commit-Queue: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1108038}
For Windows and CUPS IPP, PrintBackend is able to add Papers with empty
page sizes. This used to be filtered out when converting a Paper into a
Media object, but now that we have strengthened the Mojo validation
conditions to disallow empty page sizes, users are encountering crashes.
Since we used to drop Papers with empty page sizes after the conversion
anyway, skip any Papers with empty page sizes.
Also, remove a single instance of an unnecessary explicit conversion
to std::string.
Bug: 1416294, 1412305
Change-Id: I608cf931f84588e65098eb6964cbe2b56e3f2f63
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4257595
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1106525}
Update dependent types as necessary to support simple testing of
equality, at times replacing existing Equals() methods.
This is in preparation for supporting correctness of propagation of
print settings in browser tests.
Bug: 1414968
Change-Id: Ic32409c377cd69e0cd07f4858f58b1bd5eceddcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4241853
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1106337}
Some files have included ApplicationServices.h even though including
CoreGraphics.h is enough. So, this CL replaces ApplicationServices.h
includes with CoreGraphics.h.
Bug: 1415248
Change-Id: I0f3da0c57648ff5cc844b3131907eeee248d300f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4253168
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1105530}
This metric attempts to capture all expected outcomes when a user
goes to print on ChromeOS.
The metric gets recorded from two places: the Print Preview UI code and
the CrOS lower level printing code.
To capture whether a printer was manually selected, a new setting
`printer_manually_selected` is added to PrintSettings (but only set for
CrOS)
Tests: browser_test, ash_unittest
Change-Id: I1bb3e91cfd248727c724e338dc06b16db86dc57e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4220653
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Gavin Williams <gavinwill@chromium.org>
Reviewed-by: Zentaro Kavanagh <zentaro@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1105485}
It is expected that the paper size and printable area are either both
provided or both empty. If there's an invalid printable area, then the
printable area should be set to the paper size. Ensure this expectation
is held by adding relevant unit tests.
Also make existing test constants constexpr.
Change-Id: Iec95f13726bb7e3dff619729ac778b0703b4535a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4250442
Commit-Queue: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1105420}
ParsePaper() in printing/backend/print_backend_utils.cc may have a case
where the paper size is empty or smaller than the printable area, or the
printable area may be empty.
PrintBackendWin has a case where the paper size is non-empty but the
printable area is empty.
These Paper states will cause the Mojo validation checks to fail, so set
the default printable area to be the paper size in these cases.
Bug: 1412305
Change-Id: Ifcf3a48e10697c1272fffc2a0a6a218be6015d39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4246840
Commit-Queue: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1105188}
Some Brother printers, such as the MFC9340CDW, have their resolution
option name as BRResolution, which we do not parse. Add it to the list
of option names that we parse.
Change-Id: I73c5a2c40365a91c4eca0504ab8b78429fe96ce1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4246801
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1104824}
Instead of relying on libcups functions to do it for us. This allows us
to bypass the awkward abstraction of cups_option_t, where all attributes
had to be encoded as strings, and send collection-type attributes like
"client-info" without relying on the undocumented internal format used
by libcups.
Bug: b:267349303
Test: send print jobs with various options to ippeveprinter
Test: print something using an actual printer
Change-Id: I7ec030c28e33dbf9a68cfbb14185c585b3a797b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4209858
Reviewed-by: Benjamin Gordon <bmgordon@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Sparik Hayrapetyan <ust@google.com>
Auto-Submit: Bryan Cain <bryancain@chromium.org>
Commit-Queue: Bryan Cain <bryancain@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1103416}
When a print job is started there can sometimes still be some user
interaction. One such case can happen on Windows when the printer
driver is configured to print to port FILE:. Should a user choose
to cancel at that point instead of selecting a file to print to,
then the print job should terminate, but should not display an
error message.
Update the lowest levels of Windows printing context code to handle
the ERROR_CANCELLED error code. Modify the PrintJobWorker and PrintJob
to handle canceling in this scenario, and make this status changes
available to observers. PrintViewManagerBase can then use this to be
aware of the canceling state and thus not show an error dialog.
Low-Coverage-Reason: Windows tests restricted by crbug.com/1256506
Bug: 1393505
Change-Id: I9acecb77c3868ca6c284919de9d7a0197c2cd9ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4220482
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Reviewed-by: Andy Phan <andyphan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1102322}
Some printer drivers have Papers with printable areas out of the bounds
of the paper size. This caused Mojo validation errors, since it
originally marked out-of-bounds printable areas as invalid. Instead, set
the printable area to be the paper size and mark it as valid.
Also set the printable area to be the paper size in Windows if the
printable area is empty.
Fixed: 1412305
Change-Id: I608a5661a0729af498f7e67308fa6410ab6ced84
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4219867
Reviewed-by: Alan Screen <awscreen@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1101298}
PrinterSemanticCapsAndDefaults::Paper now has a printable area field.
ParsePaper() should be able to fill this field, so add a CupsPrinter
parameter to read the media margins and calculate the printable area.
This makes ParsePaper() CUPS IPP only.
Modifying ParsePaper() will now allow CUPS IPP printers to get the
printable area.
Also make CupsPrinter::GetMediaMarginsByName() const to be able to use
it with const CupsPrinters.
Bug: 879284
Change-Id: I3afab61f0b8895ed91e7ad43be760cae824941c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4123177
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1099993}
Add and retrieve information about printable area when fetching
PrinterSemanticCapsAndDefaults from the printer driver.
This will allow Print Preview to retrieve printable area information
once when calling PrintBackend::GetPrinterSemanticCapsAndDefaults(), so
Print Preview does not have to communicate with the printer driver
multiple times for the printable area.
Bug: 879284
Change-Id: If28734a35f94be7f0eb77de7ce14e3dfe588a617
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4104564
Commit-Queue: Andy Phan <andyphan@chromium.org>
Reviewed-by: Mustafa Emre Acer <meacer@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1099567}
Add test coverage for case where a cancel occurs right at the start of
printing. This can happen at least for Windows, for printer drivers
which print to file and thus display a dialog to choose the filename.
The user is able to cancel out at this point.
Illustrates that an error dialog is shown when this situation occurs,
even though the cancel was due to a user action.
Bug: 1393505
Change-Id: Iaf751373f650f5cdc5a6ead67582d64766687b4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4205936
Reviewed-by: Andy Phan <andyphan@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1099341}
The macOS code for handling color model included some special cases for
certain OEM-specific variations. In crrev.com/c/4166275 it was noted
that not all of these were included in the general PPD color model
processing code. Incorporate these previously identified special cases
in the general PPD special case color model parsing.
During PPD scanning it was noticed that the SelectColor name was only
used by Konica-Minolta. Update its constant identifier name to reflect
that, to be consistent with other names which are specific to a single
OEM.
Also include support for Canon printers use the "CNColorMode" attribute
instead of other commonly used attributes to specify the color model.
Manually tested against Canon MF644Cdw, with IPP enabled and disabled,
and with drivers installed via mDNS as well as by selecting from an
installed PPD.
Bug: 1210992, 1221303
Change-Id: Ie93c0069afcc1ad686fd7fd2038089030fa4f738
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4179163
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1097641}
Locality should help avoid future cases where new variations of
OEM-specific names get added but are missing for macOS special handling.
Bug: 1210992
Change-Id: I891b4b3f4be8f44ca84b4cbd0b857de04f3a5fb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4174591
Commit-Queue: Alan Screen <awscreen@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1097042}
Explcitly link with libcups when building for ChromeOS device.
cups-config is currently used from debian sysroot which does not
makes sense for ChromeOS device builds.
Without it, Chrome fails to build for ChromeOS device target.
Bug: b:265165506
Change-Id: I75a64823c4d4d13161c3215218ffd76dcc7496bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4157994
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1096510}
The strict config currently just enables -Wexit-time-destructors, just
like in //pdf/BUILD.gn. The strict config is not applied to test code,
where static initializers and exit-time destructors have traditionally
been tolerated. Then fix code that triggers the new warning.
Bug: 101600
Change-Id: Ief6002062c5c49744792d2adff417843b4f3b7c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4179674
Reviewed-by: Sparik Hayrapetyan <ust@google.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1094535}
Add RAW_PTR_EXCLUSION to files in mojo/ etc. where the rewriter could not automatically rewrite.
Change was generated by processing the output of the rewriter.
Bug: 1273182
Change-Id: I9490baa7ecdd17dbacb3180324da0f0e5e7e2401
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4173490
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Owners-Override: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1094321}
When macOS uses CUPS IPP interface it might still expect certain PPD
color values if the printer was added to the system using a PPD.
The Mac code has been using hard-coded string for such PPD values, even
if a corresponding constant was defined and available elsewhere.
Update the known PPD color settings table to make use of commonly
defined constants. Add new printing CUPS constants for the values which
were previously only in the Mac code.
Bug: 1210992
Change-Id: I75fcf0fe9b81d26de9ede0a2d984b340c8dc9651
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4166275
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1094197}
The hard-coded enum value is not compatible with a stable and
extensible Mojo enum. This value cannot be moved when the enum has new
values appended to it.
Use the auto-generated kMaxValue in its place.
Bug: 1210992
Change-Id: I8ab17a52901ff478013ce2c72a6bedf1f072a8f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4176099
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1093993}
The CUPS constants used for specifying color model and selection have
been spread across multiple files, sometimes with a duplicate
specification.
Consolidate all of these into a new print job constants file. This
requires a slight rename in usage for the consolidated cases which had
been duplicates.
Bug: 1210992
Change-Id: I3f02bec75747c4a4e317500bd0f89cce00171ef3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4165914
Commit-Queue: Alan Screen <awscreen@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1093641}
PrintSettings included two variations of CUPS color model constants.
The values in the variations are the same except for whether a "cups-"
prefix is present. Such a prefix is only needed when used by the GTK
printing code.
Simplify the definition in PrintSettings to only have one set of such
color model constant definitions.
Update PrintDialogGtk to prepend the "cups-" prefix for the provided
color model, similar to what it already does for advanced settings.
This adjustment paves the way for further cleanup of CUPS constants
within //printing.
Bug: 1210992
Change-Id: Icc3fcec97e8dd469b255291277b9fa1656928aa3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4165913
Commit-Queue: Alan Screen <awscreen@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1093398}