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

Side by Side Diff: chrome/browser/extensions/api/hid/hid_device_manager.cc

Issue 178193030: Rename ProfileKeyedAPI to BrowserContextKeyedAPI and GetProfile to Get. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits 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 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 "chrome/browser/extensions/api/hid/hid_device_manager.h" 5 #include "chrome/browser/extensions/api/hid/hid_device_manager.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "device/hid/hid_service.h" 11 #include "device/hid/hid_service.h"
12 12
13 using device::HidService; 13 using device::HidService;
14 14
15 namespace extensions { 15 namespace extensions {
16 16
17 HidDeviceManager::HidDeviceManager(content::BrowserContext* context) 17 HidDeviceManager::HidDeviceManager(content::BrowserContext* context)
18 : next_resource_id_(0) {} 18 : next_resource_id_(0) {}
19 19
20 HidDeviceManager::~HidDeviceManager() {} 20 HidDeviceManager::~HidDeviceManager() {}
21 21
22 // static 22 // static
23 ProfileKeyedAPIFactory<HidDeviceManager>* 23 BrowserContextKeyedAPIFactory<HidDeviceManager>*
24 HidDeviceManager::GetFactoryInstance() { 24 HidDeviceManager::GetFactoryInstance() {
25 static base::LazyInstance<ProfileKeyedAPIFactory<HidDeviceManager> > factory = 25 static base::LazyInstance<BrowserContextKeyedAPIFactory<HidDeviceManager> >
26 LAZY_INSTANCE_INITIALIZER; 26 factory = LAZY_INSTANCE_INITIALIZER;
27 return &factory.Get(); 27 return &factory.Get();
28 } 28 }
29 29
30 scoped_ptr<base::ListValue> HidDeviceManager::GetApiDevices( 30 scoped_ptr<base::ListValue> HidDeviceManager::GetApiDevices(
31 uint16_t vendor_id, 31 uint16_t vendor_id,
32 uint16_t product_id) { 32 uint16_t product_id) {
33 UpdateDevices(); 33 UpdateDevices();
34 34
35 HidService* hid_service = HidService::GetInstance(); 35 HidService* hid_service = HidService::GetInstance();
36 DCHECK(hid_service); 36 DCHECK(hid_service);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 new_id = next_resource_id_++; 96 new_id = next_resource_id_++;
97 } 97 }
98 new_resource_ids[device_info.device_id] = new_id; 98 new_resource_ids[device_info.device_id] = new_id;
99 new_device_ids[new_id] = device_info.device_id; 99 new_device_ids[new_id] = device_info.device_id;
100 } 100 }
101 device_ids_.swap(new_device_ids); 101 device_ids_.swap(new_device_ids);
102 resource_ids_.swap(new_resource_ids); 102 resource_ids_.swap(new_resource_ids);
103 } 103 }
104 104
105 } // namespace extensions 105 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/hid/hid_device_manager.h ('k') | chrome/browser/extensions/api/history/history_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698