Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3340)

Unified Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.cc

Issue 189483006: [Print Preview] Re-add flags for register promos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/print_preview/print_preview_handler.cc
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index a68f6d9978e5c5fa75e0b198206e3a121270c5e1..eb67359d8e87512c9228a79f8cd69acc6c610ae0 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -1359,9 +1359,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) {
@@ -1531,12 +1535,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);
}
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698