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

Side by Side Diff: chrome/browser/printing/cloud_print/privet_notifications.cc

Issue 1641563002: Remove linked_ptr usage in //base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rebase, really Created 4 years, 10 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/printing/cloud_print/privet_notifications.h" 5 #include "chrome/browser/printing/cloud_print/privet_notifications.h"
6 6
7 #include <utility> 7 #include <utility>
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 DeviceContextMap::iterator found = devices_seen_.find(name); 94 DeviceContextMap::iterator found = devices_seen_.find(name);
95 if (found != devices_seen_.end()) { 95 if (found != devices_seen_.end()) {
96 if (!description.id.empty() && // Device is registered 96 if (!description.id.empty() && // Device is registered
97 found->second->notification_may_be_active) { 97 found->second->notification_may_be_active) {
98 found->second->notification_may_be_active = false; 98 found->second->notification_may_be_active = false;
99 NotifyDeviceRemoved(); 99 NotifyDeviceRemoved();
100 } 100 }
101 return; // Already saw this device. 101 return; // Already saw this device.
102 } 102 }
103 103
104 linked_ptr<DeviceContext> device_context(new DeviceContext); 104 scoped_ptr<DeviceContext>& device_context = devices_seen_[name];
105 105 device_context.reset(new DeviceContext);
106 device_context->notification_may_be_active = false; 106 device_context->notification_may_be_active = false;
107 device_context->registered = !description.id.empty(); 107 device_context->registered = !description.id.empty();
108 108
109 devices_seen_.insert(make_pair(name, device_context));
110
111 if (!device_context->registered) { 109 if (!device_context->registered) {
112 device_context->privet_http_resolution = 110 device_context->privet_http_resolution =
113 privet_http_factory_->CreatePrivetHTTP(name); 111 privet_http_factory_->CreatePrivetHTTP(name);
114 device_context->privet_http_resolution->Start( 112 device_context->privet_http_resolution->Start(
115 description.address, 113 description.address,
116 base::Bind(&PrivetNotificationsListener::CreateInfoOperation, 114 base::Bind(&PrivetNotificationsListener::CreateInfoOperation,
117 base::Unretained(this))); 115 base::Unretained(this)));
118 } 116 }
119 } 117 }
120 118
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 384
387 void PrivetNotificationDelegate::DisableNotifications() { 385 void PrivetNotificationDelegate::DisableNotifications() {
388 Profile* profile_obj = Profile::FromBrowserContext(profile_); 386 Profile* profile_obj = Profile::FromBrowserContext(profile_);
389 387
390 profile_obj->GetPrefs()->SetBoolean( 388 profile_obj->GetPrefs()->SetBoolean(
391 prefs::kLocalDiscoveryNotificationsEnabled, 389 prefs::kLocalDiscoveryNotificationsEnabled,
392 false); 390 false);
393 } 391 }
394 392
395 } // namespace cloud_print 393 } // namespace cloud_print
OLDNEW
« no previous file with comments | « chrome/browser/printing/cloud_print/privet_notifications.h ('k') | components/guest_view/browser/guest_view_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698