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

Side by Side Diff: chrome/browser/local_discovery/privet_notifications.cc

Issue 320683002: Extracted PrivetV1HTTPClient with Privet v1 specific operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
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/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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 void ReportPrivetUmaEvent(PrivetNotificationsEvent privet_event) { 67 void ReportPrivetUmaEvent(PrivetNotificationsEvent privet_event) {
68 UMA_HISTOGRAM_ENUMERATION("LocalDiscovery.PrivetNotificationsEvent", 68 UMA_HISTOGRAM_ENUMERATION("LocalDiscovery.PrivetNotificationsEvent",
69 privet_event, PRIVET_EVENT_MAX); 69 privet_event, PRIVET_EVENT_MAX);
70 } 70 }
71 71
72 } // namespace 72 } // namespace
73 73
74 PrivetNotificationsListener::PrivetNotificationsListener( 74 PrivetNotificationsListener::PrivetNotificationsListener(
75 scoped_ptr<PrivetHTTPAsynchronousFactory> privet_http_factory, 75 scoped_ptr<PrivetHTTPAsynchronousFactory> privet_http_factory,
76 Delegate* delegate) : delegate_(delegate), devices_active_(0) { 76 Delegate* delegate)
77 : delegate_(delegate), devices_active_(0) {
77 privet_http_factory_.swap(privet_http_factory); 78 privet_http_factory_.swap(privet_http_factory);
78 } 79 }
79 80
80 PrivetNotificationsListener::~PrivetNotificationsListener() { 81 PrivetNotificationsListener::~PrivetNotificationsListener() {
81 } 82 }
82 83
83 void PrivetNotificationsListener::DeviceChanged( 84 void PrivetNotificationsListener::DeviceChanged(
84 bool added, 85 bool added,
85 const std::string& name, 86 const std::string& name,
86 const DeviceDescription& description) { 87 const DeviceDescription& description) {
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 402
402 void PrivetNotificationDelegate::DisableNotifications() { 403 void PrivetNotificationDelegate::DisableNotifications() {
403 Profile* profile_obj = Profile::FromBrowserContext(profile_); 404 Profile* profile_obj = Profile::FromBrowserContext(profile_);
404 405
405 profile_obj->GetPrefs()->SetBoolean( 406 profile_obj->GetPrefs()->SetBoolean(
406 prefs::kLocalDiscoveryNotificationsEnabled, 407 prefs::kLocalDiscoveryNotificationsEnabled,
407 false); 408 false);
408 } 409 }
409 410
410 } // namespace local_discovery 411 } // namespace local_discovery
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698