| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "components/mus/common/types.h" | 9 #include "components/mus/common/types.h" |
| 10 #include "components/mus/common/util.h" | 10 #include "components/mus/common/util.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 mus::mojom::WindowTreePtr tree, | 63 mus::mojom::WindowTreePtr tree, |
| 64 Id focused_window_id, | 64 Id focused_window_id, |
| 65 uint32_t access_policy) override { | 65 uint32_t access_policy) override { |
| 66 // TODO(sky): add test coverage of |focused_window_id|. | 66 // TODO(sky): add test coverage of |focused_window_id|. |
| 67 tracker_.OnEmbed(connection_id, root.Pass()); | 67 tracker_.OnEmbed(connection_id, root.Pass()); |
| 68 } | 68 } |
| 69 void OnEmbeddedAppDisconnected(uint32_t window) override { | 69 void OnEmbeddedAppDisconnected(uint32_t window) override { |
| 70 tracker_.OnEmbeddedAppDisconnected(window); | 70 tracker_.OnEmbeddedAppDisconnected(window); |
| 71 } | 71 } |
| 72 void OnUnembed() override { tracker_.OnUnembed(); } | 72 void OnUnembed() override { tracker_.OnUnembed(); } |
| 73 void OnLostCapture(Id window_id) override {} |
| 73 void OnWindowBoundsChanged(uint32_t window, | 74 void OnWindowBoundsChanged(uint32_t window, |
| 74 mojo::RectPtr old_bounds, | 75 mojo::RectPtr old_bounds, |
| 75 mojo::RectPtr new_bounds) override { | 76 mojo::RectPtr new_bounds) override { |
| 76 tracker_.OnWindowBoundsChanged(window, old_bounds.Pass(), | 77 tracker_.OnWindowBoundsChanged(window, old_bounds.Pass(), |
| 77 new_bounds.Pass()); | 78 new_bounds.Pass()); |
| 78 } | 79 } |
| 79 void OnClientAreaChanged(uint32_t window_id, | 80 void OnClientAreaChanged(uint32_t window_id, |
| 80 mojo::InsetsPtr old_client_area, | 81 mojo::InsetsPtr old_client_area, |
| 81 mojo::InsetsPtr new_client_area) override {} | 82 mojo::InsetsPtr new_client_area) override {} |
| 82 void OnTransientWindowAdded(uint32_t window_id, | 83 void OnTransientWindowAdded(uint32_t window_id, |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 // root-window is created). | 230 // root-window is created). |
| 230 mojom::ViewportMetrics metrics; | 231 mojom::ViewportMetrics metrics; |
| 231 metrics.size_in_pixels = mojo::Size::From(gfx::Size(400, 300)); | 232 metrics.size_in_pixels = mojo::Size::From(gfx::Size(400, 300)); |
| 232 metrics.device_pixel_ratio = 1.f; | 233 metrics.device_pixel_ratio = 1.f; |
| 233 delegate->OnViewportMetricsChanged(mojom::ViewportMetrics(), metrics); | 234 delegate->OnViewportMetricsChanged(mojom::ViewportMetrics(), metrics); |
| 234 } | 235 } |
| 235 void SchedulePaint(const ServerWindow* window, | 236 void SchedulePaint(const ServerWindow* window, |
| 236 const gfx::Rect& bounds) override {} | 237 const gfx::Rect& bounds) override {} |
| 237 void SetViewportSize(const gfx::Size& size) override {} | 238 void SetViewportSize(const gfx::Size& size) override {} |
| 238 void SetTitle(const base::string16& title) override {} | 239 void SetTitle(const base::string16& title) override {} |
| 240 void SetCapture() override {} |
| 241 void ReleaseCapture() override {} |
| 239 const mojom::ViewportMetrics& GetViewportMetrics() override { | 242 const mojom::ViewportMetrics& GetViewportMetrics() override { |
| 240 return display_metrices_; | 243 return display_metrices_; |
| 241 } | 244 } |
| 242 void UpdateTextInputState(const ui::TextInputState& state) override {} | 245 void UpdateTextInputState(const ui::TextInputState& state) override {} |
| 243 void SetImeVisibility(bool visible) override {} | 246 void SetImeVisibility(bool visible) override {} |
| 244 bool IsFramePending() const override { return false; } | 247 bool IsFramePending() const override { return false; } |
| 245 | 248 |
| 246 private: | 249 private: |
| 247 mojom::ViewportMetrics display_metrices_; | 250 mojom::ViewportMetrics display_metrices_; |
| 248 | 251 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 ASSERT_EQ(2u, embed_connection->tracker()->changes()->size()); | 483 ASSERT_EQ(2u, embed_connection->tracker()->changes()->size()); |
| 481 EXPECT_EQ("Focused id=2,1", | 484 EXPECT_EQ("Focused id=2,1", |
| 482 ChangesToDescription1(*embed_connection->tracker()->changes())[0]); | 485 ChangesToDescription1(*embed_connection->tracker()->changes())[0]); |
| 483 EXPECT_EQ("InputEvent window=2,1 event_action=4", | 486 EXPECT_EQ("InputEvent window=2,1 event_action=4", |
| 484 ChangesToDescription1(*embed_connection->tracker()->changes())[1]); | 487 ChangesToDescription1(*embed_connection->tracker()->changes())[1]); |
| 485 } | 488 } |
| 486 | 489 |
| 487 } // namespace ws | 490 } // namespace ws |
| 488 | 491 |
| 489 } // namespace mus | 492 } // namespace mus |
| OLD | NEW |