| 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 "services/ui/public/cpp/window_tree_client.h" | 5 #include "services/ui/public/cpp/window_tree_client.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 public: | 52 public: |
| 53 TestWindowTreeClientDelegate() {} | 53 TestWindowTreeClientDelegate() {} |
| 54 ~TestWindowTreeClientDelegate() override {} | 54 ~TestWindowTreeClientDelegate() override {} |
| 55 | 55 |
| 56 ui::PointerEvent* last_event_observed() { return last_event_observed_.get(); } | 56 ui::PointerEvent* last_event_observed() { return last_event_observed_.get(); } |
| 57 | 57 |
| 58 void Reset() { last_event_observed_.reset(); } | 58 void Reset() { last_event_observed_.reset(); } |
| 59 | 59 |
| 60 // WindowTreeClientDelegate: | 60 // WindowTreeClientDelegate: |
| 61 void OnEmbed(Window* root) override {} | 61 void OnEmbed(Window* root) override {} |
| 62 void OnDidDestroyClient(WindowTreeClient* client) override {} | 62 void OnLostConnection(WindowTreeClient* client) override {} |
| 63 void OnEmbedRootDestroyed(Window* root) override {} |
| 63 void OnPointerEventObserved(const ui::PointerEvent& event, | 64 void OnPointerEventObserved(const ui::PointerEvent& event, |
| 64 Window* target) override { | 65 Window* target) override { |
| 65 last_event_observed_.reset(new ui::PointerEvent(event)); | 66 last_event_observed_.reset(new ui::PointerEvent(event)); |
| 66 } | 67 } |
| 67 | 68 |
| 68 private: | 69 private: |
| 69 std::unique_ptr<ui::PointerEvent> last_event_observed_; | 70 std::unique_ptr<ui::PointerEvent> last_event_observed_; |
| 70 | 71 |
| 71 DISALLOW_COPY_AND_ASSIGN(TestWindowTreeClientDelegate); | 72 DISALLOW_COPY_AND_ASSIGN(TestWindowTreeClientDelegate); |
| 72 }; | 73 }; |
| (...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1075 | 1076 |
| 1076 // Changes originating from server should notify observers too. | 1077 // Changes originating from server should notify observers too. |
| 1077 WindowTreeClientPrivate(setup.client()).CallOnCaptureChanged(child2, nullptr); | 1078 WindowTreeClientPrivate(setup.client()).CallOnCaptureChanged(child2, nullptr); |
| 1078 EXPECT_EQ(1, capture_recorder.capture_changed_count()); | 1079 EXPECT_EQ(1, capture_recorder.capture_changed_count()); |
| 1079 EXPECT_EQ(child2_id, capture_recorder.last_gained_capture_window_id()); | 1080 EXPECT_EQ(child2_id, capture_recorder.last_gained_capture_window_id()); |
| 1080 EXPECT_EQ(0, capture_recorder.last_lost_capture_window_id()); | 1081 EXPECT_EQ(0, capture_recorder.last_lost_capture_window_id()); |
| 1081 capture_recorder.reset_capture_captured_count(); | 1082 capture_recorder.reset_capture_captured_count(); |
| 1082 } | 1083 } |
| 1083 | 1084 |
| 1084 } // namespace ui | 1085 } // namespace ui |
| OLD | NEW |