documentScan: Add handler for getScannerList
This introduces the data types and flow of the new
documentScan.getScannerList function. This function does the following:
1. Confirm that the user wants to discover scanners through an
explicit prompt similar to the one shown by chrome.printing. This
can be bypassed with the new kDocumentScanAPITrustedExtensions
preference.
2. Send the request to ash Chrome through crosapi.
3. When the response comes back, replace all of the SANE connection
strings with ungessable tokens.
Most of the heavy lifting is done in the new ScannerDiscoveryRunner
class so that the callbacks don't have to pass huge numbers of
parameters along.
Bug: b/297435442
Change-Id: I2e3020604280a1e96f6df0dc18687c16492cc21f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5030262
Reviewed-by: David Trainor <[email protected]>
Commit-Queue: Benjamin Gordon <[email protected]>
Reviewed-by: Devlin Cronin <[email protected]>
Reviewed-by: Emilia Paz <[email protected]>
Reviewed-by: Tom Sepez <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1230361}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 87e05b5..6b4daf9 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -322,6 +322,7 @@
#include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager_impl.h"
#include "chrome/browser/chromeos/quickoffice/quickoffice_prefs.h"
#include "chrome/browser/chromeos/reporting/metric_reporting_prefs.h"
+#include "chrome/browser/extensions/api/document_scan/document_scan_api_handler.h"
#include "chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h"
#include "chrome/browser/memory/oom_kills_monitor.h"
#include "chrome/browser/policy/networking/policy_cert_service.h"
@@ -1893,6 +1894,7 @@
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_CHROMEOS)
+ extensions::DocumentScanAPIHandler::RegisterProfilePrefs(registry);
extensions::login_api::RegisterProfilePrefs(registry);
extensions::platform_keys::RegisterProfilePrefs(registry);
certificate_manager::CertificatesHandler::RegisterProfilePrefs(registry);