2019-07-17 20:47:27 +02:00
|
|
|
diff --git chrome/browser/download/download_prefs.cc chrome/browser/download/download_prefs.cc
|
2020-04-14 21:31:00 +02:00
|
|
|
index 00d1c0fa2b00..45dcadc79fb2 100644
|
2019-07-17 20:47:27 +02:00
|
|
|
--- chrome/browser/download/download_prefs.cc
|
|
|
|
+++ chrome/browser/download/download_prefs.cc
|
|
|
|
@@ -22,6 +22,7 @@
|
|
|
|
#include "base/strings/sys_string_conversions.h"
|
|
|
|
#include "base/strings/utf_string_conversions.h"
|
|
|
|
#include "build/build_config.h"
|
|
|
|
+#include "cef/libcef/features/features.h"
|
|
|
|
#include "chrome/browser/download/chrome_download_manager_delegate.h"
|
|
|
|
#include "chrome/browser/download/download_core_service_factory.h"
|
|
|
|
#include "chrome/browser/download/download_core_service_impl.h"
|
2019-11-12 17:11:44 +01:00
|
|
|
@@ -53,6 +54,10 @@
|
2019-07-17 20:47:27 +02:00
|
|
|
#include "chrome/browser/ui/pdf/adobe_reader_info_win.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+#if BUILDFLAG(ENABLE_CEF)
|
|
|
|
+#include "cef/libcef/browser/browser_context.h"
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
using content::BrowserContext;
|
|
|
|
using content::BrowserThread;
|
|
|
|
using content::DownloadManager;
|
2020-02-10 18:10:17 +01:00
|
|
|
@@ -309,7 +314,11 @@ DownloadPrefs* DownloadPrefs::FromDownloadManager(
|
2019-07-17 20:47:27 +02:00
|
|
|
// static
|
|
|
|
DownloadPrefs* DownloadPrefs::FromBrowserContext(
|
|
|
|
content::BrowserContext* context) {
|
|
|
|
+#if !BUILDFLAG(ENABLE_CEF)
|
|
|
|
return FromDownloadManager(BrowserContext::GetDownloadManager(context));
|
|
|
|
+#else
|
|
|
|
+ return CefBrowserContext::GetForContext(context)->GetDownloadPrefs();
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
bool DownloadPrefs::IsFromTrustedSource(const download::DownloadItem& item) {
|
|
|
|
diff --git chrome/browser/printing/print_preview_dialog_controller.cc chrome/browser/printing/print_preview_dialog_controller.cc
|
2020-03-30 22:13:42 +02:00
|
|
|
index 84818167bce1..cdbd3f7f6f27 100644
|
2019-07-17 20:47:27 +02:00
|
|
|
--- chrome/browser/printing/print_preview_dialog_controller.cc
|
|
|
|
+++ chrome/browser/printing/print_preview_dialog_controller.cc
|
2019-10-01 15:55:16 +02:00
|
|
|
@@ -16,6 +16,7 @@
|
2019-07-17 20:47:27 +02:00
|
|
|
#include "base/strings/utf_string_conversions.h"
|
2019-10-01 15:55:16 +02:00
|
|
|
#include "build/branding_buildflags.h"
|
2019-07-17 20:47:27 +02:00
|
|
|
#include "build/build_config.h"
|
|
|
|
+#include "cef/libcef/features/features.h"
|
|
|
|
#include "chrome/browser/browser_process.h"
|
|
|
|
#include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
|
2019-09-04 17:13:32 +02:00
|
|
|
#include "chrome/browser/printing/print_view_manager.h"
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -451,8 +452,11 @@ WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog(
|
2019-07-17 20:47:27 +02:00
|
|
|
content::HostZoomMap::Get(preview_dialog->GetSiteInstance())
|
|
|
|
->SetZoomLevelForHostAndScheme(print_url.scheme(), print_url.host(), 0);
|
|
|
|
PrintViewManager::CreateForWebContents(preview_dialog);
|
|
|
|
+
|
|
|
|
+#if !BUILDFLAG(ENABLE_CEF)
|
|
|
|
extensions::ChromeExtensionWebContentsObserver::CreateForWebContents(
|
|
|
|
preview_dialog);
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
// Add an entry to the map.
|
|
|
|
preview_dialog_map_[preview_dialog] = initiator;
|
|
|
|
diff --git chrome/browser/resources/print_preview/ui/destination_dialog.html chrome/browser/resources/print_preview/ui/destination_dialog.html
|
2020-03-04 01:29:39 +01:00
|
|
|
index 56a6a8d8ee67..5fecf7ad1780 100644
|
2019-07-17 20:47:27 +02:00
|
|
|
--- chrome/browser/resources/print_preview/ui/destination_dialog.html
|
|
|
|
+++ chrome/browser/resources/print_preview/ui/destination_dialog.html
|
2020-03-04 01:29:39 +01:00
|
|
|
@@ -141,9 +141,7 @@
|
2020-02-10 18:10:17 +01:00
|
|
|
</print-preview-provisional-destination-resolver>
|
|
|
|
</div>
|
|
|
|
<div slot="button-container">
|
|
|
|
- <cr-button on-click="onOpenSettingsPrintPage_">
|
|
|
|
- $i18n{manage}
|
|
|
|
- </cr-button>
|
|
|
|
+ <div></div>
|
|
|
|
<cr-button class="cancel-button" on-click="onCancelButtonClick_">
|
|
|
|
$i18n{cancel}
|
|
|
|
</cr-button>
|
2019-07-17 20:47:27 +02:00
|
|
|
diff --git chrome/browser/resources/print_preview/ui/destination_select.html chrome/browser/resources/print_preview/ui/destination_select.html
|
2020-03-04 01:29:39 +01:00
|
|
|
index c93947a7634c..c60cada63ef8 100644
|
2019-07-17 20:47:27 +02:00
|
|
|
--- chrome/browser/resources/print_preview/ui/destination_select.html
|
|
|
|
+++ chrome/browser/resources/print_preview/ui/destination_select.html
|
2020-02-10 18:10:17 +01:00
|
|
|
@@ -31,10 +31,6 @@
|
|
|
|
hidden$="[[pdfPrinterDisabled]]">
|
|
|
|
$i18n{printToPDF}
|
|
|
|
</option>
|
|
|
|
- <option value="[[getGoogleDriveDestinationKey_(activeUser)]]"
|
2020-03-04 01:29:39 +01:00
|
|
|
- hidden$="[[!driveDestinationReady]]">
|
2020-02-10 18:10:17 +01:00
|
|
|
- $i18n{printToGoogleDrive}
|
|
|
|
- </option>
|
|
|
|
<option value="noDestinations"
|
|
|
|
hidden$="[[!noDestinations]]" selected$="[[noDestinations]]">
|
|
|
|
$i18n{noDestinationsMessage}
|
2019-07-17 20:47:27 +02:00
|
|
|
diff --git chrome/browser/ui/webui/constrained_web_dialog_ui.cc chrome/browser/ui/webui/constrained_web_dialog_ui.cc
|
2020-02-10 18:10:17 +01:00
|
|
|
index b59728f623e3..6fd443962836 100644
|
2019-07-17 20:47:27 +02:00
|
|
|
--- chrome/browser/ui/webui/constrained_web_dialog_ui.cc
|
|
|
|
+++ chrome/browser/ui/webui/constrained_web_dialog_ui.cc
|
2020-02-10 18:10:17 +01:00
|
|
|
@@ -26,6 +26,8 @@
|
2019-07-17 20:47:27 +02:00
|
|
|
#include "chrome/browser/extensions/tab_helper.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+#include "cef/libcef/features/features.h"
|
|
|
|
+
|
|
|
|
using content::RenderFrameHost;
|
|
|
|
using content::WebContents;
|
2020-02-10 18:10:17 +01:00
|
|
|
using content::WebUIMessageHandler;
|
|
|
|
@@ -55,8 +57,10 @@ class ConstrainedWebDialogDelegateUserData
|
2019-07-17 20:47:27 +02:00
|
|
|
ConstrainedWebDialogUI::ConstrainedWebDialogUI(content::WebUI* web_ui)
|
|
|
|
: WebUIController(web_ui) {
|
|
|
|
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
|
|
|
+#if !BUILDFLAG(ENABLE_CEF)
|
|
|
|
extensions::TabHelper::CreateForWebContents(web_ui->GetWebContents());
|
|
|
|
#endif
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
ConstrainedWebDialogUI::~ConstrainedWebDialogUI() {
|
|
|
|
diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc
|
2020-03-30 22:13:42 +02:00
|
|
|
index 394ce8f66012..fe0e14e27fd1 100644
|
2019-07-17 20:47:27 +02:00
|
|
|
--- chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc
|
|
|
|
+++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -178,8 +178,10 @@ PdfPrinterHandler::PdfPrinterHandler(
|
2019-09-04 17:13:32 +02:00
|
|
|
sticky_settings_(sticky_settings) {}
|
2019-07-17 20:47:27 +02:00
|
|
|
|
|
|
|
PdfPrinterHandler::~PdfPrinterHandler() {
|
|
|
|
+#if !BUILDFLAG(ENABLE_CEF)
|
|
|
|
if (select_file_dialog_.get())
|
|
|
|
select_file_dialog_->ListenerDestroyed();
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void PdfPrinterHandler::Reset() {
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -226,12 +228,14 @@ void PdfPrinterHandler::StartPrint(
|
2019-07-17 20:47:27 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#if !BUILDFLAG(ENABLE_CEF)
|
|
|
|
if (select_file_dialog_ &&
|
|
|
|
select_file_dialog_->IsRunning(
|
|
|
|
platform_util::GetTopLevel(preview_web_contents_->GetNativeView()))) {
|
|
|
|
// Dialog is already showing.
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
DCHECK(!print_callback_);
|
|
|
|
print_callback_ = std::move(callback);
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -370,7 +374,11 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename,
|
2019-07-17 20:47:27 +02:00
|
|
|
// If the directory is empty there is no reason to create it or use the
|
|
|
|
// default location.
|
|
|
|
if (path.empty()) {
|
|
|
|
+#if !BUILDFLAG(ENABLE_CEF)
|
|
|
|
OnDirectorySelected(default_filename, path);
|
|
|
|
+#else
|
|
|
|
+ ShowCefSaveAsDialog(initiator, default_filename, path);
|
|
|
|
+#endif
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -380,8 +388,14 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename,
|
|
|
|
base::ThreadPool::PostTaskAndReplyWithResult(
|
|
|
|
FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
|
2019-07-17 20:47:27 +02:00
|
|
|
base::BindOnce(&SelectSaveDirectory, path, default_path),
|
|
|
|
+#if !BUILDFLAG(ENABLE_CEF)
|
|
|
|
base::BindOnce(&PdfPrinterHandler::OnDirectorySelected,
|
|
|
|
weak_ptr_factory_.GetWeakPtr(), default_filename));
|
|
|
|
+#else
|
|
|
|
+ base::BindOnce(&PdfPrinterHandler::ShowCefSaveAsDialog,
|
|
|
|
+ weak_ptr_factory_.GetWeakPtr(), initiator,
|
2019-07-25 15:17:27 +02:00
|
|
|
+ default_filename));
|
2019-07-17 20:47:27 +02:00
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void PdfPrinterHandler::PostPrintToPdfTask() {
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -397,6 +411,7 @@ void PdfPrinterHandler::OnGotUniqueFileName(const base::FilePath& path) {
|
2019-07-17 20:47:27 +02:00
|
|
|
FileSelected(path, 0, nullptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
+#if !BUILDFLAG(ENABLE_CEF)
|
|
|
|
void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename,
|
|
|
|
const base::FilePath& directory) {
|
|
|
|
base::FilePath path = directory.Append(filename);
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -421,5 +436,36 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename,
|
2019-07-17 20:47:27 +02:00
|
|
|
&file_type_info, 0, base::FilePath::StringType(),
|
|
|
|
platform_util::GetTopLevel(preview_web_contents_->GetNativeView()), NULL);
|
|
|
|
}
|
|
|
|
+#else
|
|
|
|
+void PdfPrinterHandler::ShowCefSaveAsDialog(content::WebContents* initiator,
|
|
|
|
+ const base::FilePath& filename,
|
|
|
|
+ const base::FilePath& directory) {
|
|
|
|
+ CefRefPtr<CefBrowserHostImpl> cef_browser =
|
|
|
|
+ CefBrowserHostImpl::GetBrowserForContents(initiator);
|
|
|
|
+ if (!cef_browser)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ base::FilePath path = directory.Append(filename);
|
|
|
|
+
|
|
|
|
+ CefFileDialogRunner::FileChooserParams params;
|
|
|
|
+ params.mode = blink::mojom::FileChooserParams::Mode::kSave;
|
|
|
|
+ params.default_file_name = path;
|
|
|
|
+ params.accept_types.push_back(CefString(path.Extension()));
|
|
|
|
+
|
|
|
|
+ cef_browser->RunFileChooser(
|
|
|
|
+ params, base::Bind(&PdfPrinterHandler::SaveAsDialogDismissed,
|
|
|
|
+ weak_ptr_factory_.GetWeakPtr()));
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void PdfPrinterHandler::SaveAsDialogDismissed(
|
|
|
|
+ int selected_accept_filter,
|
|
|
|
+ const std::vector<base::FilePath>& file_paths) {
|
|
|
|
+ if (file_paths.size() == 1) {
|
|
|
|
+ FileSelected(file_paths[0], 0, nullptr);
|
|
|
|
+ } else {
|
|
|
|
+ FileSelectionCanceled(nullptr);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
} // namespace printing
|
|
|
|
diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.h chrome/browser/ui/webui/print_preview/pdf_printer_handler.h
|
2020-02-10 18:10:17 +01:00
|
|
|
index 0881b3dd9303..4df6883d4d05 100644
|
2019-07-17 20:47:27 +02:00
|
|
|
--- chrome/browser/ui/webui/print_preview/pdf_printer_handler.h
|
|
|
|
+++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.h
|
2019-07-25 15:17:27 +02:00
|
|
|
@@ -11,9 +11,14 @@
|
2019-07-17 20:47:27 +02:00
|
|
|
#include "base/memory/ref_counted.h"
|
|
|
|
#include "base/memory/weak_ptr.h"
|
|
|
|
#include "base/strings/string16.h"
|
|
|
|
+#include "cef/libcef/features/features.h"
|
|
|
|
#include "chrome/browser/ui/webui/print_preview/printer_handler.h"
|
|
|
|
#include "ui/shell_dialogs/select_file_dialog.h"
|
2019-07-25 15:17:27 +02:00
|
|
|
|
|
|
|
+#if BUILDFLAG(ENABLE_CEF)
|
2019-07-17 20:47:27 +02:00
|
|
|
+#include "cef/libcef/browser/browser_host_impl.h"
|
|
|
|
+#endif
|
2019-07-25 15:17:27 +02:00
|
|
|
+
|
2019-07-17 20:47:27 +02:00
|
|
|
namespace base {
|
|
|
|
class FilePath;
|
|
|
|
class RefCountedMemory;
|
2020-02-10 18:10:17 +01:00
|
|
|
@@ -76,17 +81,28 @@ class PdfPrinterHandler : public PrinterHandler,
|
2019-07-17 20:47:27 +02:00
|
|
|
// The print preview web contents. Protected so unit tests can access it.
|
|
|
|
content::WebContents* const preview_web_contents_;
|
|
|
|
|
|
|
|
+#if !BUILDFLAG(ENABLE_CEF)
|
|
|
|
// The underlying dialog object. Protected so unit tests can access it.
|
|
|
|
scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
private:
|
|
|
|
void PostPrintToPdfTask();
|
|
|
|
void OnGotUniqueFileName(const base::FilePath& path);
|
|
|
|
|
|
|
|
+#if !BUILDFLAG(ENABLE_CEF)
|
|
|
|
// Prompts the user to save the file. The dialog will default to saving
|
|
|
|
// the file with name |filename| in |directory|.
|
|
|
|
void OnDirectorySelected(const base::FilePath& filename,
|
|
|
|
const base::FilePath& directory);
|
|
|
|
+#else
|
|
|
|
+ void ShowCefSaveAsDialog(content::WebContents* initiator,
|
|
|
|
+ const base::FilePath& filename,
|
|
|
|
+ const base::FilePath& directory);
|
|
|
|
+
|
|
|
|
+ void SaveAsDialogDismissed(int selected_accept_filter,
|
|
|
|
+ const std::vector<base::FilePath>& file_paths);
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
Profile* const profile_;
|
2020-02-10 18:10:17 +01:00
|
|
|
PrintPreviewStickySettings* const sticky_settings_;
|
2019-07-17 20:47:27 +02:00
|
|
|
diff --git chrome/browser/ui/webui/print_preview/print_preview_handler.cc chrome/browser/ui/webui/print_preview/print_preview_handler.cc
|
2020-04-14 21:31:00 +02:00
|
|
|
index 113d34201f90..8834b94c5475 100644
|
2019-07-17 20:47:27 +02:00
|
|
|
--- chrome/browser/ui/webui/print_preview/print_preview_handler.cc
|
|
|
|
+++ chrome/browser/ui/webui/print_preview/print_preview_handler.cc
|
2020-03-04 01:29:39 +01:00
|
|
|
@@ -27,6 +27,7 @@
|
2019-07-17 20:47:27 +02:00
|
|
|
#include "base/metrics/histogram_macros.h"
|
|
|
|
#include "base/values.h"
|
|
|
|
#include "build/build_config.h"
|
|
|
|
+#include "cef/libcef/features/features.h"
|
|
|
|
#include "chrome/browser/app_mode/app_mode_utils.h"
|
|
|
|
#include "chrome/browser/bad_message.h"
|
|
|
|
#include "chrome/browser/browser_process.h"
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -1146,7 +1147,7 @@ void PrintPreviewHandler::SendInitialSettings(
|
2020-02-10 18:10:17 +01:00
|
|
|
initial_settings.SetKey(kPolicies, std::move(policies));
|
|
|
|
|
|
|
|
if (IsCloudPrintEnabled() &&
|
|
|
|
- !base::FeatureList::IsEnabled(features::kCloudPrinterHandler)) {
|
|
|
|
+ !base::FeatureList::IsEnabled(::features::kCloudPrinterHandler)) {
|
|
|
|
initial_settings.SetStringKey(
|
|
|
|
kCloudPrintURL, GURL(cloud_devices::GetCloudPrintURL()).spec());
|
|
|
|
}
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -1411,6 +1412,9 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler(
|
2019-07-17 20:47:27 +02:00
|
|
|
}
|
|
|
|
return privet_printer_handler_.get();
|
|
|
|
}
|
|
|
|
+#else // !BUILDFLAG(ENABLE_SERVICE_DISCOVERY)
|
|
|
|
+ if (printer_type == PrinterType::kPrivetPrinter)
|
|
|
|
+ return nullptr;
|
|
|
|
#endif
|
|
|
|
if (printer_type == PrinterType::kPdfPrinter) {
|
|
|
|
if (!pdf_printer_handler_) {
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -1430,7 +1434,7 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler(
|
2020-02-10 18:10:17 +01:00
|
|
|
if (printer_type == PrinterType::kCloudPrinter) {
|
|
|
|
// This printer handler is currently experimental. Ensure it is never
|
|
|
|
// created unless the flag is enabled.
|
|
|
|
- CHECK(base::FeatureList::IsEnabled(features::kCloudPrinterHandler));
|
|
|
|
+ CHECK(base::FeatureList::IsEnabled(::features::kCloudPrinterHandler));
|
|
|
|
if (!cloud_printer_handler_)
|
|
|
|
cloud_printer_handler_ = PrinterHandler::CreateForCloudPrinters();
|
|
|
|
return cloud_printer_handler_.get();
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -1493,6 +1497,7 @@ void PrintPreviewHandler::OnPrintResult(const std::string& callback_id,
|
2019-07-17 20:47:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void PrintPreviewHandler::RegisterForGaiaCookieChanges() {
|
|
|
|
+#if !BUILDFLAG(ENABLE_CEF)
|
|
|
|
DCHECK(!identity_manager_);
|
|
|
|
cloud_print_enabled_ =
|
2020-02-10 18:10:17 +01:00
|
|
|
!base::Contains(printer_type_deny_list_, kCloudPrinter) &&
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -1509,6 +1514,7 @@ void PrintPreviewHandler::RegisterForGaiaCookieChanges() {
|
2019-07-17 20:47:27 +02:00
|
|
|
|
|
|
|
identity_manager_ = IdentityManagerFactory::GetForProfile(profile);
|
|
|
|
identity_manager_->AddObserver(this);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void PrintPreviewHandler::UnregisterForGaiaCookieChanges() {
|
|
|
|
diff --git chrome/browser/ui/webui/print_preview/print_preview_ui.cc chrome/browser/ui/webui/print_preview/print_preview_ui.cc
|
2020-04-14 21:31:00 +02:00
|
|
|
index cf3c71f478da..8438a234eb8b 100644
|
2019-07-17 20:47:27 +02:00
|
|
|
--- chrome/browser/ui/webui/print_preview/print_preview_ui.cc
|
|
|
|
+++ chrome/browser/ui/webui/print_preview/print_preview_ui.cc
|
2020-02-10 18:10:17 +01:00
|
|
|
@@ -24,6 +24,7 @@
|
2019-07-17 20:47:27 +02:00
|
|
|
#include "base/synchronization/lock.h"
|
|
|
|
#include "base/values.h"
|
|
|
|
#include "build/build_config.h"
|
|
|
|
+#include "cef/libcef/features/features.h"
|
|
|
|
#include "chrome/browser/browser_process.h"
|
2019-11-12 17:11:44 +01:00
|
|
|
#include "chrome/browser/browser_process_platform_part.h"
|
2019-07-17 20:47:27 +02:00
|
|
|
#include "chrome/browser/printing/background_printing_manager.h"
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -76,12 +77,16 @@ namespace printing {
|
2019-07-17 20:47:27 +02:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
+#if BUILDFLAG(ENABLE_CEF)
|
|
|
|
+const char kBasicPrintShortcut[] = "";
|
|
|
|
+#else
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
// U+0028 U+21E7 U+2318 U+0050 U+0029 in UTF8
|
|
|
|
const char kBasicPrintShortcut[] = "\x28\xE2\x8c\xA5\xE2\x8C\x98\x50\x29";
|
|
|
|
#elif !defined(OS_CHROMEOS)
|
|
|
|
const char kBasicPrintShortcut[] = "(Ctrl+Shift+P)";
|
|
|
|
#endif
|
|
|
|
+#endif
|
|
|
|
|
2020-02-10 18:10:17 +01:00
|
|
|
#if !BUILDFLAG(OPTIMIZE_WEBUI)
|
|
|
|
constexpr char kGeneratedPath[] =
|
2020-04-14 21:31:00 +02:00
|
|
|
@@ -332,7 +337,7 @@ void AddPrintPreviewFlags(content::WebUIDataSource* source, Profile* profile) {
|
2020-02-10 18:10:17 +01:00
|
|
|
source->AddBoolean("isEnterpriseManaged", enterprise_managed);
|
2019-07-17 20:47:27 +02:00
|
|
|
|
2020-02-10 18:10:17 +01:00
|
|
|
bool cloud_printer_handler_enabled =
|
|
|
|
- base::FeatureList::IsEnabled(features::kCloudPrinterHandler);
|
|
|
|
+ base::FeatureList::IsEnabled(::features::kCloudPrinterHandler);
|
|
|
|
source->AddBoolean("cloudPrinterHandlerEnabled",
|
|
|
|
cloud_printer_handler_enabled);
|
|
|
|
}
|