OLD | NEW |
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/autotest_private/autotest_private_api.h" | 5 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 result->SetString("message", notification->message()); | 371 result->SetString("message", notification->message()); |
372 result->SetInteger("priority", notification->priority()); | 372 result->SetInteger("priority", notification->priority()); |
373 result->SetInteger("progress", notification->progress()); | 373 result->SetInteger("progress", notification->progress()); |
374 values->Append(std::move(result)); | 374 values->Append(std::move(result)); |
375 } | 375 } |
376 | 376 |
377 #endif | 377 #endif |
378 return RespondNow(OneArgument(std::move(values))); | 378 return RespondNow(OneArgument(std::move(values))); |
379 } | 379 } |
380 | 380 |
381 static base::LazyInstance<BrowserContextKeyedAPIFactory<AutotestPrivateAPI> > | 381 static base::LazyInstance<BrowserContextKeyedAPIFactory<AutotestPrivateAPI>>:: |
382 g_factory = LAZY_INSTANCE_INITIALIZER; | 382 DestructorAtExit g_factory = LAZY_INSTANCE_INITIALIZER; |
383 | 383 |
384 // static | 384 // static |
385 BrowserContextKeyedAPIFactory<AutotestPrivateAPI>* | 385 BrowserContextKeyedAPIFactory<AutotestPrivateAPI>* |
386 AutotestPrivateAPI::GetFactoryInstance() { | 386 AutotestPrivateAPI::GetFactoryInstance() { |
387 return g_factory.Pointer(); | 387 return g_factory.Pointer(); |
388 } | 388 } |
389 | 389 |
390 template <> | 390 template <> |
391 KeyedService* | 391 KeyedService* |
392 BrowserContextKeyedAPIFactory<AutotestPrivateAPI>::BuildServiceInstanceFor( | 392 BrowserContextKeyedAPIFactory<AutotestPrivateAPI>::BuildServiceInstanceFor( |
393 content::BrowserContext* context) const { | 393 content::BrowserContext* context) const { |
394 return new AutotestPrivateAPI(); | 394 return new AutotestPrivateAPI(); |
395 } | 395 } |
396 | 396 |
397 AutotestPrivateAPI::AutotestPrivateAPI() : test_mode_(false) { | 397 AutotestPrivateAPI::AutotestPrivateAPI() : test_mode_(false) { |
398 } | 398 } |
399 | 399 |
400 AutotestPrivateAPI::~AutotestPrivateAPI() { | 400 AutotestPrivateAPI::~AutotestPrivateAPI() { |
401 } | 401 } |
402 | 402 |
403 } // namespace extensions | 403 } // namespace extensions |
OLD | NEW |