Hook up chrome.printerProvider.onPrintRequested
commit44f4c2fef4f1c0e86977a161459f4b067abf6af6
authortbarzic <tbarzic@chromium.org>
Thu, 22 Jan 2015 00:43:33 +0000 (21 16:43 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 22 Jan 2015 00:44:34 +0000 (22 00:44 +0000)
treeeb26f562347eb59fe6fa988bec61c3b0ce5028cb
parente53409112ade857d53896ee0891d25a0f692ae3c
Hook up chrome.printerProvider.onPrintRequested

This adds PrinterProviderAPI service which implements logic for dispatching
onPrintRequested event, and keeps track of pending event callbacks.

Adds PrinterProviderInternalAPI service and
PrinterProviderInternalAPIObserver. The internal API service keeps observer list,
which gets notified when printerProviderInternal API functions get called.

PrinterProviderAPI observes PrinterProviderInternalAPI service for when
print request result is reported, and runs the appropriate callback.
The callback is identified by the request_id param passed to the
internal API function (whose value is the one passed to chrome.printerProvider
event when it's dispatched).

BUG=408772

Review URL: https://codereview.chromium.org/853263002

Cr-Commit-Position: refs/heads/master@{#312506}
12 files changed:
extensions/browser/BUILD.gn
extensions/browser/api/printer_provider/OWNERS [new file with mode: 0644]
extensions/browser/api/printer_provider/printer_provider_api.cc [new file with mode: 0644]
extensions/browser/api/printer_provider/printer_provider_api.h [new file with mode: 0644]
extensions/browser/api/printer_provider/printer_provider_apitest.cc [new file with mode: 0644]
extensions/browser/api/printer_provider_internal/printer_provider_internal_api.cc
extensions/browser/api/printer_provider_internal/printer_provider_internal_api.h
extensions/browser/api/printer_provider_internal/printer_provider_internal_api_observer.h [new file with mode: 0644]
extensions/extensions.gyp
extensions/shell/app_shell.gyp
extensions/test/data/api_test/printer_provider/request_print/manifest.json [new file with mode: 0644]
extensions/test/data/api_test/printer_provider/request_print/test.js [new file with mode: 0644]