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

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

Issue 1129083003: More base::Values-related bare pointer -> scoped_ptr conversions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bad merge Created 5 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
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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 if (description.id.empty()) { 363 if (description.id.empty()) {
364 info.SetString(kDictionaryKeyServiceName, name); 364 info.SetString(kDictionaryKeyServiceName, name);
365 info.SetString(kDictionaryKeyDisplayName, description.name); 365 info.SetString(kDictionaryKeyDisplayName, description.name);
366 info.SetString(kDictionaryKeyDescription, description.description); 366 info.SetString(kDictionaryKeyDescription, description.description);
367 info.SetString(kDictionaryKeyType, description.type); 367 info.SetString(kDictionaryKeyType, description.type);
368 info.SetBoolean(kDictionaryKeyIsWifi, false); 368 info.SetBoolean(kDictionaryKeyIsWifi, false);
369 369
370 web_ui()->CallJavascriptFunction( 370 web_ui()->CallJavascriptFunction(
371 "local_discovery.onUnregisteredDeviceUpdate", service_key, info); 371 "local_discovery.onUnregisteredDeviceUpdate", service_key, info);
372 } else { 372 } else {
373 scoped_ptr<base::Value> null_value(base::Value::CreateNullValue()); 373 scoped_ptr<base::Value> null_value = base::Value::CreateNullValue();
374 374
375 web_ui()->CallJavascriptFunction( 375 web_ui()->CallJavascriptFunction(
376 "local_discovery.onUnregisteredDeviceUpdate", service_key, *null_value); 376 "local_discovery.onUnregisteredDeviceUpdate", service_key, *null_value);
377 } 377 }
378 } 378 }
379 379
380 void LocalDiscoveryUIHandler::DeviceRemoved(const std::string& name) { 380 void LocalDiscoveryUIHandler::DeviceRemoved(const std::string& name) {
381 device_descriptions_.erase(name); 381 device_descriptions_.erase(name);
382 scoped_ptr<base::Value> null_value(base::Value::CreateNullValue()); 382 scoped_ptr<base::Value> null_value = base::Value::CreateNullValue();
383 base::StringValue name_value(kKeyPrefixMDns + name); 383 base::StringValue name_value(kKeyPrefixMDns + name);
384 384
385 web_ui()->CallJavascriptFunction("local_discovery.onUnregisteredDeviceUpdate", 385 web_ui()->CallJavascriptFunction("local_discovery.onUnregisteredDeviceUpdate",
386 name_value, *null_value); 386 name_value, *null_value);
387 } 387 }
388 388
389 void LocalDiscoveryUIHandler::DeviceCacheFlushed() { 389 void LocalDiscoveryUIHandler::DeviceCacheFlushed() {
390 web_ui()->CallJavascriptFunction("local_discovery.onDeviceCacheFlushed"); 390 web_ui()->CallJavascriptFunction("local_discovery.onDeviceCacheFlushed");
391 privet_lister_->DiscoverNewDevices(false); 391 privet_lister_->DiscoverNewDevices(false);
392 } 392 }
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 640
641 void LocalDiscoveryUIHandler::RefreshCloudPrintStatusFromService() { 641 void LocalDiscoveryUIHandler::RefreshCloudPrintStatusFromService() {
642 if (cloud_print_connector_ui_enabled_) 642 if (cloud_print_connector_ui_enabled_)
643 CloudPrintProxyServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()))-> 643 CloudPrintProxyServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()))->
644 RefreshStatusFromService(); 644 RefreshStatusFromService();
645 } 645 }
646 646
647 #endif // cloud print connector option stuff 647 #endif // cloud print connector option stuff
648 648
649 } // namespace local_discovery 649 } // namespace local_discovery
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698