Commit f0392397 authored by noamsml@chromium.org's avatar noamsml@chromium.org

[Print Preview] Re-add flags for register promos

Register promos are not cleared for M34. Re-add the flags for the register
promo.

BUG=350488

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256014 0039d316-1c4b-4281-b951-d872f2087c98
parent 821f71b0
......@@ -5651,6 +5651,12 @@ Keep your key file in a safe place. You will need it to create new versions of y
Fallback to XPS. By default <ph name="CLOUD_PRINT_NAME">$1<ex>Google Cloud Print</ex></ph> uses CDD.
</message>
</if>
<message name="IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_NAME">
Enable Print Preview Registration Promos
</message>
<message name="IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_DESCRIPTION">
Enable registering unregistered cloud printers from print preview.
</message>
<message name="IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME" desc="Title of the touch-optimized UI flag." >
Touch Optimized UI
</message>
......
......@@ -1473,6 +1473,13 @@ const Experiment kExperiments[] = {
kOsWin | kOsLinux | kOsCrOS,
SINGLE_VALUE_TYPE(switches::kDisablePrivetLocalPrinting)
},
{
"enable-print-preview-register-promos",
IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_NAME,
IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_DESCRIPTION,
kOsWin | kOsLinux | kOsCrOS,
SINGLE_VALUE_TYPE(switches::kEnablePrintPreviewRegisterPromos)
},
#endif // ENABLE_MDNS
#if defined(OS_WIN)
{
......
......@@ -1361,9 +1361,13 @@ void PrintPreviewHandler::LocalPrinterChanged(
const std::string& name,
bool has_local_printing,
const local_discovery::DeviceDescription& description) {
base::DictionaryValue info;
FillPrinterDescription(name, description, has_local_printing, &info);
web_ui()->CallJavascriptFunction("onPrivetPrinterChanged", info);
CommandLine* command_line = CommandLine::ForCurrentProcess();
if (has_local_printing ||
command_line->HasSwitch(switches::kEnablePrintPreviewRegisterPromos)) {
base::DictionaryValue info;
FillPrinterDescription(name, description, has_local_printing, &info);
web_ui()->CallJavascriptFunction("onPrivetPrinterChanged", info);
}
}
void PrintPreviewHandler::LocalPrinterRemoved(const std::string& name) {
......@@ -1533,12 +1537,15 @@ void PrintPreviewHandler::FillPrinterDescription(
const local_discovery::DeviceDescription& description,
bool has_local_printing,
base::DictionaryValue* printer_value) {
CommandLine* command_line = CommandLine::ForCurrentProcess();
printer_value->SetString("serviceName", name);
printer_value->SetString("name", description.name);
printer_value->SetBoolean("hasLocalPrinting", has_local_printing);
printer_value->SetBoolean(
"isUnregistered",
description.id.empty());
description.id.empty() &&
command_line->HasSwitch(switches::kEnablePrintPreviewRegisterPromos));
printer_value->SetString("cloudID", description.id);
}
......
......@@ -694,6 +694,10 @@ const char kEnableOriginChipV2HideOnUserInput[] =
// Enables panels (always on-top docked pop-up windows).
const char kEnablePanels[] = "enable-panels";
// Enables showing unregistered printers in print preview
const char kEnablePrintPreviewRegisterPromos[] =
"enable-print-preview-register-promos";
// Enable Privet storage.
const char kEnablePrivetStorage[] = "enable-privet-storage";
......
......@@ -202,6 +202,7 @@ extern const char kEnablePanels[];
extern const char kEnablePasswordAutofillPublicSuffixDomainMatching[];
extern const char kEnablePermissionsBubbles[];
extern const char kEnableQueryExtraction[];
extern const char kEnablePrintPreviewRegisterPromos[];
extern const char kEnablePrivetStorage[];
extern const char kEnableProfiling[];
extern const char kEnableQuic[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment