| 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 "content/shell/renderer/test_runner/mock_presentation_service.h" | 5 #include "content/shell/renderer/test_runner/mock_presentation_service.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 screen_availability_ = available; | 22 screen_availability_ = available; |
| 23 | 23 |
| 24 FOR_EACH_OBSERVER( | 24 FOR_EACH_OBSERVER( |
| 25 MockPresentationClient, | 25 MockPresentationClient, |
| 26 presentation_clients_, | 26 presentation_clients_, |
| 27 SetScreenAvailability(available)); | 27 SetScreenAvailability(available)); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void MockPresentationService::Reset() { | 30 void MockPresentationService::Reset() { |
| 31 FOR_EACH_OBSERVER(MockPresentationClient, presentation_clients_, Reset()); | 31 FOR_EACH_OBSERVER(MockPresentationClient, presentation_clients_, Reset()); |
| 32 presentation_clients_.Clear(); |
| 32 screen_availability_ = false; | 33 screen_availability_ = false; |
| 33 } | 34 } |
| 34 | 35 |
| 35 void MockPresentationService::RegisterPresentationClientMock( | 36 void MockPresentationService::RegisterPresentationClientMock( |
| 36 MockPresentationClient* client) { | 37 MockPresentationClient* client) { |
| 37 DCHECK(client); | 38 DCHECK(client); |
| 38 presentation_clients_.AddObserver(client); | 39 presentation_clients_.AddObserver(client); |
| 39 } | 40 } |
| 40 | 41 |
| 41 void MockPresentationService::UnregisterPresentationClientMock( | 42 void MockPresentationService::UnregisterPresentationClientMock( |
| 42 MockPresentationClient* client) { | 43 MockPresentationClient* client) { |
| 43 DCHECK(client); | 44 DCHECK(client); |
| 44 presentation_clients_.RemoveObserver(client); | 45 presentation_clients_.RemoveObserver(client); |
| 45 } | 46 } |
| 46 | 47 |
| 47 } // namespace content | 48 } // namespace content |
| OLD | NEW |