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

Side by Side Diff: chrome/browser/extensions/api/usb/usb_api.cc

Issue 177003015: Pull AsyncApiFunction out of src/chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/api/usb/usb_api.h" 5 #include "chrome/browser/extensions/api/usb/usb_api.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 namespace extensions { 389 namespace extensions {
390 390
391 UsbAsyncApiFunction::UsbAsyncApiFunction() 391 UsbAsyncApiFunction::UsbAsyncApiFunction()
392 : manager_(NULL) { 392 : manager_(NULL) {
393 } 393 }
394 394
395 UsbAsyncApiFunction::~UsbAsyncApiFunction() { 395 UsbAsyncApiFunction::~UsbAsyncApiFunction() {
396 } 396 }
397 397
398 bool UsbAsyncApiFunction::PrePrepare() { 398 bool UsbAsyncApiFunction::PrePrepare() {
399 manager_ = ApiResourceManager<UsbDeviceResource>::Get(GetProfile()); 399 manager_ = ApiResourceManager<UsbDeviceResource>::Get(context());
400 set_work_thread_id(BrowserThread::FILE); 400 set_work_thread_id(BrowserThread::FILE);
401 return manager_ != NULL; 401 return manager_ != NULL;
402 } 402 }
403 403
404 bool UsbAsyncApiFunction::Respond() { 404 bool UsbAsyncApiFunction::Respond() {
405 return error_.empty(); 405 return error_.empty();
406 } 406 }
407 407
408 scoped_refptr<UsbDevice> 408 scoped_refptr<UsbDevice>
409 UsbAsyncApiFunction::GetDeviceOrOrCompleteWithError( 409 UsbAsyncApiFunction::GetDeviceOrOrCompleteWithError(
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 SetResult(new base::FundamentalValue(false)); 1171 SetResult(new base::FundamentalValue(false));
1172 CompleteWithError(kErrorResetDevice); 1172 CompleteWithError(kErrorResetDevice);
1173 return; 1173 return;
1174 } 1174 }
1175 1175
1176 SetResult(new base::FundamentalValue(true)); 1176 SetResult(new base::FundamentalValue(true));
1177 AsyncWorkCompleted(); 1177 AsyncWorkCompleted();
1178 } 1178 }
1179 1179
1180 } // namespace extensions 1180 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698