| OLD | NEW |
| 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/local_discovery/privet_notifications.h" | 5 #include "chrome/browser/local_discovery/privet_notifications.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 traffic_detector_ = NULL; | 344 traffic_detector_ = NULL; |
| 345 #endif // ENABLE_MDNS | 345 #endif // ENABLE_MDNS |
| 346 service_discovery_client_ = ServiceDiscoverySharedClient::GetInstance(); | 346 service_discovery_client_ = ServiceDiscoverySharedClient::GetInstance(); |
| 347 device_lister_.reset( | 347 device_lister_.reset( |
| 348 new PrivetDeviceListerImpl(service_discovery_client_.get(), this)); | 348 new PrivetDeviceListerImpl(service_discovery_client_.get(), this)); |
| 349 device_lister_->Start(); | 349 device_lister_->Start(); |
| 350 device_lister_->DiscoverNewDevices(false); | 350 device_lister_->DiscoverNewDevices(false); |
| 351 | 351 |
| 352 scoped_ptr<PrivetHTTPAsynchronousFactory> http_factory( | 352 scoped_ptr<PrivetHTTPAsynchronousFactory> http_factory( |
| 353 PrivetHTTPAsynchronousFactory::CreateInstance( | 353 PrivetHTTPAsynchronousFactory::CreateInstance( |
| 354 service_discovery_client_.get(), profile_->GetRequestContext())); | 354 profile_->GetRequestContext())); |
| 355 | 355 |
| 356 privet_notifications_listener_.reset(new PrivetNotificationsListener( | 356 privet_notifications_listener_.reset(new PrivetNotificationsListener( |
| 357 http_factory.Pass(), this)); | 357 http_factory.Pass(), this)); |
| 358 } | 358 } |
| 359 | 359 |
| 360 PrivetNotificationDelegate::PrivetNotificationDelegate( | 360 PrivetNotificationDelegate::PrivetNotificationDelegate( |
| 361 content::BrowserContext* profile) | 361 content::BrowserContext* profile) |
| 362 : profile_(profile) { | 362 : profile_(profile) { |
| 363 } | 363 } |
| 364 | 364 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 391 | 391 |
| 392 void PrivetNotificationDelegate::DisableNotifications() { | 392 void PrivetNotificationDelegate::DisableNotifications() { |
| 393 Profile* profile_obj = Profile::FromBrowserContext(profile_); | 393 Profile* profile_obj = Profile::FromBrowserContext(profile_); |
| 394 | 394 |
| 395 profile_obj->GetPrefs()->SetBoolean( | 395 profile_obj->GetPrefs()->SetBoolean( |
| 396 prefs::kLocalDiscoveryNotificationsEnabled, | 396 prefs::kLocalDiscoveryNotificationsEnabled, |
| 397 false); | 397 false); |
| 398 } | 398 } |
| 399 | 399 |
| 400 } // namespace local_discovery | 400 } // namespace local_discovery |
| OLD | NEW |