| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SERVICES_DEVICE_WAKE_LOCK_WAKE_LOCK_SERVICE_IMPL_FOR_TESTING_H_ | |
| 6 #define SERVICES_DEVICE_WAKE_LOCK_WAKE_LOCK_SERVICE_IMPL_FOR_TESTING_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/ref_counted.h" | |
| 12 #include "base/single_thread_task_runner.h" | |
| 13 #include "device/wake_lock/public/interfaces/wake_lock_context.mojom.h" | |
| 14 #include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h" | |
| 15 #include "device/wake_lock/wake_lock_service_impl.h" | |
| 16 #include "mojo/public/cpp/bindings/binding_set.h" | |
| 17 #include "ui/gfx/native_widget_types.h" | |
| 18 | |
| 19 namespace device { | |
| 20 | |
| 21 class WakeLockServiceImplForTesting : public WakeLockServiceImpl { | |
| 22 public: | |
| 23 WakeLockServiceImplForTesting( | |
| 24 mojom::WakeLockServiceRequest request, | |
| 25 mojom::WakeLockType type, | |
| 26 mojom::WakeLockReason reason, | |
| 27 const std::string& description, | |
| 28 int context_id, | |
| 29 WakeLockContextCallback native_view_getter, | |
| 30 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner); | |
| 31 ~WakeLockServiceImplForTesting() override; | |
| 32 | |
| 33 void HasWakeLockForTests(HasWakeLockForTestsCallback callback) override; | |
| 34 | |
| 35 private: | |
| 36 void UpdateWakeLock() override; | |
| 37 void CreateWakeLock() override; | |
| 38 void RemoveWakeLock() override; | |
| 39 | |
| 40 bool has_wake_lock_; | |
| 41 | |
| 42 DISALLOW_COPY_AND_ASSIGN(WakeLockServiceImplForTesting); | |
| 43 }; | |
| 44 | |
| 45 } // namespace device | |
| 46 | |
| 47 #endif // SERVICES_DEVICE_WAKE_LOCK_WAKE_LOCK_SERVICE_IMPL_FOR_TESTING_H_ | |
| OLD | NEW |