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 "mojo/services/view_manager/test_change_tracker.h" | 5 #include "mojo/services/view_manager/test_change_tracker.h" |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "mojo/common/common_type_converters.h" | 9 #include "mojo/common/common_type_converters.h" |
10 #include "mojo/services/public/cpp/view_manager/util.h" | 10 #include "mojo/services/public/cpp/view_manager/util.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 } | 242 } |
243 | 243 |
244 void TestChangeTracker::OnViewInputEvent(Id view_id, EventPtr event) { | 244 void TestChangeTracker::OnViewInputEvent(Id view_id, EventPtr event) { |
245 Change change; | 245 Change change; |
246 change.type = CHANGE_TYPE_INPUT_EVENT; | 246 change.type = CHANGE_TYPE_INPUT_EVENT; |
247 change.view_id = view_id; | 247 change.view_id = view_id; |
248 change.event_action = event->action; | 248 change.event_action = event->action; |
249 AddChange(change); | 249 AddChange(change); |
250 } | 250 } |
251 | 251 |
252 void TestChangeTracker::OnViewPropertyChanged(Id view_id, | 252 void TestChangeTracker::OnViewSharedPropertyChanged(Id view_id, |
253 String name, | 253 String name, |
254 Array<uint8_t> data) { | 254 Array<uint8_t> data) { |
255 Change change; | 255 Change change; |
256 change.type = CHANGE_TYPE_PROPERTY_CHANGED; | 256 change.type = CHANGE_TYPE_PROPERTY_CHANGED; |
257 change.view_id = view_id; | 257 change.view_id = view_id; |
258 change.property_key = name; | 258 change.property_key = name; |
259 if (data.is_null()) | 259 if (data.is_null()) |
260 change.property_value = "NULL"; | 260 change.property_value = "NULL"; |
261 else | 261 else |
262 change.property_value = data.To<std::string>(); | 262 change.property_value = data.To<std::string>(); |
263 AddChange(change); | 263 AddChange(change); |
264 } | 264 } |
(...skipping 24 matching lines...) Expand all Loading... |
289 std::string TestView::ToString2() const { | 289 std::string TestView::ToString2() const { |
290 return base::StringPrintf("view=%s parent=%s visible=%s drawn=%s", | 290 return base::StringPrintf("view=%s parent=%s visible=%s drawn=%s", |
291 ViewIdToString(view_id).c_str(), | 291 ViewIdToString(view_id).c_str(), |
292 ViewIdToString(parent_id).c_str(), | 292 ViewIdToString(parent_id).c_str(), |
293 visible ? "true" : "false", | 293 visible ? "true" : "false", |
294 drawn ? "true" : "false"); | 294 drawn ? "true" : "false"); |
295 } | 295 } |
296 | 296 |
297 } // namespace service | 297 } // namespace service |
298 } // namespace mojo | 298 } // namespace mojo |
OLD | NEW |