OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/layer_tree_json_parser.h" | 5 #include "cc/test/layer_tree_json_parser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/test/values_test_util.h" | 9 #include "base/test/values_test_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // | 118 // |
119 // For now, we can safely indicate a layer is scrollable by giving it a | 119 // For now, we can safely indicate a layer is scrollable by giving it a |
120 // pointer to itself, something not normally allowed in a working tree. | 120 // pointer to itself, something not normally allowed in a working tree. |
121 // | 121 // |
122 // https://code.google.com/p/chromium/issues/detail?id=330622 | 122 // https://code.google.com/p/chromium/issues/detail?id=330622 |
123 // | 123 // |
124 if (dict->GetBoolean("Scrollable", &scrollable)) | 124 if (dict->GetBoolean("Scrollable", &scrollable)) |
125 new_layer->SetScrollClipLayerId(scrollable ? new_layer->id() | 125 new_layer->SetScrollClipLayerId(scrollable ? new_layer->id() |
126 : Layer::INVALID_ID); | 126 : Layer::INVALID_ID); |
127 | 127 |
128 bool wheel_handler; | |
129 if (dict->GetBoolean("WheelHandler", &wheel_handler)) | |
130 new_layer->SetHaveWheelEventHandlers(wheel_handler); | |
131 | |
132 bool scroll_handler; | 128 bool scroll_handler; |
133 if (dict->GetBoolean("ScrollHandler", &scroll_handler)) | 129 if (dict->GetBoolean("ScrollHandler", &scroll_handler)) |
134 new_layer->SetHaveScrollEventHandlers(scroll_handler); | 130 new_layer->SetHaveScrollEventHandlers(scroll_handler); |
135 | 131 |
136 bool is_3d_sorted; | 132 bool is_3d_sorted; |
137 if (dict->GetBoolean("Is3DSorted", &is_3d_sorted)) { | 133 if (dict->GetBoolean("Is3DSorted", &is_3d_sorted)) { |
138 // A non-zero context ID will put the layer into a 3D sorting context | 134 // A non-zero context ID will put the layer into a 3D sorting context |
139 new_layer->Set3dSortingContextId(is_3d_sorted ? 1 : 0); | 135 new_layer->Set3dSortingContextId(is_3d_sorted ? 1 : 0); |
140 } | 136 } |
141 | 137 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 172 |
177 } // namespace | 173 } // namespace |
178 | 174 |
179 scoped_refptr<Layer> ParseTreeFromJson(std::string json, | 175 scoped_refptr<Layer> ParseTreeFromJson(std::string json, |
180 ContentLayerClient* content_client) { | 176 ContentLayerClient* content_client) { |
181 scoped_ptr<base::Value> val = base::test::ParseJson(json); | 177 scoped_ptr<base::Value> val = base::test::ParseJson(json); |
182 return ParseTreeFromValue(val.get(), content_client); | 178 return ParseTreeFromValue(val.get(), content_client); |
183 } | 179 } |
184 | 180 |
185 } // namespace cc | 181 } // namespace cc |
OLD | NEW |