| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "cc/test/remote_client_layer_factory.h" | 5 #include "cc/test/remote_client_layer_factory.h" |
| 6 | 6 |
| 7 #include "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
| 8 #include "cc/layers/picture_layer.h" |
| 9 #include "cc/layers/solid_color_scrollbar_layer.h" |
| 8 | 10 |
| 9 namespace cc { | 11 namespace cc { |
| 10 namespace { | 12 namespace { |
| 11 class ClientLayer : public Layer { | 13 class ClientLayer : public Layer { |
| 12 public: | 14 public: |
| 13 explicit ClientLayer(int engine_layer_id) : Layer(engine_layer_id) {} | 15 explicit ClientLayer(int engine_layer_id) : Layer(engine_layer_id) {} |
| 14 | 16 |
| 15 private: | 17 private: |
| 16 ~ClientLayer() override {} | 18 ~ClientLayer() override {} |
| 17 }; | 19 }; |
| 20 |
| 21 class ClientPictureLayer : public PictureLayer { |
| 22 public: |
| 23 explicit ClientPictureLayer(int engine_layer_id, |
| 24 ContentLayerClient* content_layer_client) |
| 25 : PictureLayer(engine_layer_id, content_layer_client) {} |
| 26 |
| 27 private: |
| 28 ~ClientPictureLayer() override {} |
| 29 }; |
| 30 |
| 31 class ClientSolidColorScrollbarLayer : public SolidColorScrollbarLayer { |
| 32 public: |
| 33 explicit ClientSolidColorScrollbarLayer(int engine_layer_id, |
| 34 ScrollbarOrientation orientation, |
| 35 int thumb_thickness, |
| 36 int track_start, |
| 37 bool is_left_side_vertical_scrollbar, |
| 38 int scroll_layer_id) |
| 39 : SolidColorScrollbarLayer(engine_layer_id, |
| 40 orientation, |
| 41 thumb_thickness, |
| 42 track_start, |
| 43 is_left_side_vertical_scrollbar, |
| 44 scroll_layer_id) {} |
| 45 |
| 46 private: |
| 47 ~ClientSolidColorScrollbarLayer() override {} |
| 48 }; |
| 49 |
| 18 } // namespace | 50 } // namespace |
| 19 | 51 |
| 20 RemoteClientLayerFactory::RemoteClientLayerFactory() = default; | 52 RemoteClientLayerFactory::RemoteClientLayerFactory() = default; |
| 21 | 53 |
| 22 RemoteClientLayerFactory::~RemoteClientLayerFactory() = default; | 54 RemoteClientLayerFactory::~RemoteClientLayerFactory() = default; |
| 23 | 55 |
| 24 scoped_refptr<Layer> RemoteClientLayerFactory::CreateLayer( | 56 scoped_refptr<Layer> RemoteClientLayerFactory::CreateLayer( |
| 25 int engine_layer_id) { | 57 int engine_layer_id) { |
| 26 return make_scoped_refptr(new ClientLayer(engine_layer_id)); | 58 return make_scoped_refptr(new ClientLayer(engine_layer_id)); |
| 27 } | 59 } |
| 28 | 60 |
| 61 scoped_refptr<PictureLayer> RemoteClientLayerFactory::CreatePictureLayer( |
| 62 int engine_layer_id, |
| 63 ContentLayerClient* content_layer_client) { |
| 64 return make_scoped_refptr( |
| 65 new ClientPictureLayer(engine_layer_id, content_layer_client)); |
| 66 } |
| 67 |
| 68 scoped_refptr<SolidColorScrollbarLayer> |
| 69 RemoteClientLayerFactory::CreateSolidColorScrollbarLayer( |
| 70 int engine_layer_id, |
| 71 ScrollbarOrientation orientation, |
| 72 int thumb_thickness, |
| 73 int track_start, |
| 74 bool is_left_side_vertical_scrollbar, |
| 75 int scroll_layer_id) { |
| 76 return make_scoped_refptr(new ClientSolidColorScrollbarLayer( |
| 77 engine_layer_id, orientation, thumb_thickness, track_start, |
| 78 is_left_side_vertical_scrollbar, scroll_layer_id)); |
| 79 } |
| 80 |
| 29 } // namespace cc | 81 } // namespace cc |
| OLD | NEW |