OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/printer_provider_internal/printer_provider_inte
rnal_api.h" | 5 #include "extensions/browser/api/printer_provider_internal/printer_provider_inte
rnal_api.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "extensions/common/api/printer_provider.h" | 28 #include "extensions/common/api/printer_provider.h" |
29 #include "extensions/common/api/printer_provider_internal.h" | 29 #include "extensions/common/api/printer_provider_internal.h" |
30 | 30 |
31 namespace internal_api = extensions::api::printer_provider_internal; | 31 namespace internal_api = extensions::api::printer_provider_internal; |
32 | 32 |
33 namespace extensions { | 33 namespace extensions { |
34 | 34 |
35 namespace { | 35 namespace { |
36 | 36 |
37 static base::LazyInstance< | 37 static base::LazyInstance< |
38 BrowserContextKeyedAPIFactory<PrinterProviderInternalAPI>> g_api_factory = | 38 BrowserContextKeyedAPIFactory<PrinterProviderInternalAPI>>::DestructorAtExit |
39 LAZY_INSTANCE_INITIALIZER; | 39 g_api_factory = LAZY_INSTANCE_INITIALIZER; |
40 | 40 |
41 } // namespace | 41 } // namespace |
42 | 42 |
43 // static | 43 // static |
44 BrowserContextKeyedAPIFactory<PrinterProviderInternalAPI>* | 44 BrowserContextKeyedAPIFactory<PrinterProviderInternalAPI>* |
45 PrinterProviderInternalAPI::GetFactoryInstance() { | 45 PrinterProviderInternalAPI::GetFactoryInstance() { |
46 return g_api_factory.Pointer(); | 46 return g_api_factory.Pointer(); |
47 } | 47 } |
48 | 48 |
49 PrinterProviderInternalAPI::PrinterProviderInternalAPI( | 49 PrinterProviderInternalAPI::PrinterProviderInternalAPI( |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 EXTENSION_FUNCTION_VALIDATE(params.get()); | 258 EXTENSION_FUNCTION_VALIDATE(params.get()); |
259 | 259 |
260 PrinterProviderInternalAPI::GetFactoryInstance() | 260 PrinterProviderInternalAPI::GetFactoryInstance() |
261 ->Get(browser_context()) | 261 ->Get(browser_context()) |
262 ->NotifyGetUsbPrinterInfoResult(extension(), params->request_id, | 262 ->NotifyGetUsbPrinterInfoResult(extension(), params->request_id, |
263 params->printer_info.get()); | 263 params->printer_info.get()); |
264 return RespondNow(NoArguments()); | 264 return RespondNow(NoArguments()); |
265 } | 265 } |
266 | 266 |
267 } // namespace extensions | 267 } // namespace extensions |
OLD | NEW |