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

Side by Side Diff: extensions/browser/api/device_permissions_prompt.cc

Issue 1155743003: Subsituting pattern ScopedVector push_back.(ptr.release()) with push_back(ptr.Pass()) in extensions… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/device_permissions_prompt.h" 5 #include "extensions/browser/api/device_permissions_prompt.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/scoped_observer.h" 8 #include "base/scoped_observer.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 devices_[index]->set_granted(); 327 devices_[index]->set_granted();
328 } 328 }
329 329
330 DevicePermissionsPrompt::Prompt::~Prompt() { 330 DevicePermissionsPrompt::Prompt::~Prompt() {
331 } 331 }
332 332
333 void DevicePermissionsPrompt::Prompt::AddCheckedDevice( 333 void DevicePermissionsPrompt::Prompt::AddCheckedDevice(
334 scoped_ptr<DeviceInfo> device, 334 scoped_ptr<DeviceInfo> device,
335 bool allowed) { 335 bool allowed) {
336 if (allowed) { 336 if (allowed) {
337 devices_.push_back(device.release()); 337 devices_.push_back(device.Pass());
338 if (observer_) { 338 if (observer_) {
339 observer_->OnDevicesChanged(); 339 observer_->OnDevicesChanged();
340 } 340 }
341 } 341 }
342 } 342 }
343 343
344 DevicePermissionsPrompt::DevicePermissionsPrompt( 344 DevicePermissionsPrompt::DevicePermissionsPrompt(
345 content::WebContents* web_contents) 345 content::WebContents* web_contents)
346 : web_contents_(web_contents) { 346 : web_contents_(web_contents) {
347 } 347 }
(...skipping 17 matching lines...) Expand all
365 content::BrowserContext* context, 365 content::BrowserContext* context,
366 bool multiple, 366 bool multiple,
367 const std::vector<HidDeviceFilter>& filters, 367 const std::vector<HidDeviceFilter>& filters,
368 const HidDevicesCallback& callback) { 368 const HidDevicesCallback& callback) {
369 prompt_ = new HidDevicePermissionsPrompt(extension, context, multiple, 369 prompt_ = new HidDevicePermissionsPrompt(extension, context, multiple,
370 filters, callback); 370 filters, callback);
371 ShowDialog(); 371 ShowDialog();
372 } 372 }
373 373
374 } // namespace extensions 374 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698