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

Side by Side Diff: chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc

Issue 284543002: Display different icons for different device types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mon 05/12/2014 14:15:39.40 Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" 5 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 349
350 base::DictionaryValue info; 350 base::DictionaryValue info;
351 351
352 base::StringValue service_name(name); 352 base::StringValue service_name(name);
353 scoped_ptr<base::Value> null_value(base::Value::CreateNullValue()); 353 scoped_ptr<base::Value> null_value(base::Value::CreateNullValue());
354 354
355 if (description.id.empty()) { 355 if (description.id.empty()) {
356 info.SetString("service_name", name); 356 info.SetString("service_name", name);
357 info.SetString("human_readable_name", description.name); 357 info.SetString("human_readable_name", description.name);
358 info.SetString("description", description.description); 358 info.SetString("description", description.description);
359 info.SetString("type", description.type);
359 360
360 web_ui()->CallJavascriptFunction( 361 web_ui()->CallJavascriptFunction(
361 "local_discovery.onUnregisteredDeviceUpdate", 362 "local_discovery.onUnregisteredDeviceUpdate",
362 service_name, info); 363 service_name, info);
363 } else { 364 } else {
364 web_ui()->CallJavascriptFunction( 365 web_ui()->CallJavascriptFunction(
365 "local_discovery.onUnregisteredDeviceUpdate", 366 "local_discovery.onUnregisteredDeviceUpdate",
366 service_name, *null_value); 367 service_name, *null_value);
367 } 368 }
368 } 369 }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 current_http_client_.reset(); 475 current_http_client_.reset();
475 } 476 }
476 477
477 scoped_ptr<base::DictionaryValue> LocalDiscoveryUIHandler::CreatePrinterInfo( 478 scoped_ptr<base::DictionaryValue> LocalDiscoveryUIHandler::CreatePrinterInfo(
478 const CloudPrintPrinterList::PrinterDetails& description) { 479 const CloudPrintPrinterList::PrinterDetails& description) {
479 scoped_ptr<base::DictionaryValue> return_value(new base::DictionaryValue); 480 scoped_ptr<base::DictionaryValue> return_value(new base::DictionaryValue);
480 481
481 return_value->SetString("id", description.id); 482 return_value->SetString("id", description.id);
482 return_value->SetString("display_name", description.display_name); 483 return_value->SetString("display_name", description.display_name);
483 return_value->SetString("description", description.description); 484 return_value->SetString("description", description.description);
485 return_value->SetString("type", "printer");
484 486
485 return return_value.Pass(); 487 return return_value.Pass();
486 } 488 }
487 489
488 void LocalDiscoveryUIHandler::CheckUserLoggedIn() { 490 void LocalDiscoveryUIHandler::CheckUserLoggedIn() {
489 base::FundamentalValue logged_in_value(!GetSyncAccount().empty()); 491 base::FundamentalValue logged_in_value(!GetSyncAccount().empty());
490 web_ui()->CallJavascriptFunction("local_discovery.setUserLoggedIn", 492 web_ui()->CallJavascriptFunction("local_discovery.setUserLoggedIn",
491 logged_in_value); 493 logged_in_value);
492 } 494 }
493 495
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 } 594 }
593 595
594 void LocalDiscoveryUIHandler::RefreshCloudPrintStatusFromService() { 596 void LocalDiscoveryUIHandler::RefreshCloudPrintStatusFromService() {
595 if (cloud_print_connector_ui_enabled_) 597 if (cloud_print_connector_ui_enabled_)
596 CloudPrintProxyServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()))-> 598 CloudPrintProxyServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()))->
597 RefreshStatusFromService(); 599 RefreshStatusFromService();
598 } 600 }
599 #endif // cloud print connector option stuff 601 #endif // cloud print connector option stuff
600 602
601 } // namespace local_discovery 603 } // namespace local_discovery
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698