| 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 "services/view_manager/test_change_tracker.h" | 5 #include "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/converters/array_string/array_string_type_converters.h" | 9 #include "mojo/converters/array_string/array_string_type_converters.h" |
| 10 #include "mojo/services/view_manager/public/cpp/util.h" | 10 #include "mojo/services/view_manager/public/cpp/util.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 std::string RectToString(const mojo::Rect& rect) { | 26 std::string RectToString(const mojo::Rect& rect) { |
| 27 return base::StringPrintf("%d,%d %dx%d", rect.x, rect.y, rect.width, | 27 return base::StringPrintf("%d,%d %dx%d", rect.x, rect.y, rect.width, |
| 28 rect.height); | 28 rect.height); |
| 29 } | 29 } |
| 30 | 30 |
| 31 std::string DirectionToString(mojo::OrderDirection direction) { | 31 std::string DirectionToString(mojo::OrderDirection direction) { |
| 32 return direction == mojo::ORDER_DIRECTION_ABOVE ? "above" : "below"; | 32 return direction == mojo::OrderDirection::ABOVE ? "above" : "below"; |
| 33 } | 33 } |
| 34 | 34 |
| 35 std::string ChangeToDescription1(const Change& change) { | 35 std::string ChangeToDescription1(const Change& change) { |
| 36 switch (change.type) { | 36 switch (change.type) { |
| 37 case CHANGE_TYPE_EMBED: | 37 case CHANGE_TYPE_EMBED: |
| 38 return base::StringPrintf("OnEmbed creator=%s", | 38 return base::StringPrintf("OnEmbed creator=%s", |
| 39 change.creator_url.data()); | 39 change.creator_url.data()); |
| 40 | 40 |
| 41 case CHANGE_TYPE_EMBEDDED_APP_DISCONNECTED: | 41 case CHANGE_TYPE_EMBEDDED_APP_DISCONNECTED: |
| 42 return base::StringPrintf("OnEmbeddedAppDisconnected view=%s", | 42 return base::StringPrintf("OnEmbeddedAppDisconnected view=%s", |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 for (size_t i = 0; i < data.size(); ++i) | 145 for (size_t i = 0; i < data.size(); ++i) |
| 146 test_views->push_back(ViewDataToTestView(data[i])); | 146 test_views->push_back(ViewDataToTestView(data[i])); |
| 147 } | 147 } |
| 148 | 148 |
| 149 Change::Change() | 149 Change::Change() |
| 150 : type(CHANGE_TYPE_EMBED), | 150 : type(CHANGE_TYPE_EMBED), |
| 151 connection_id(0), | 151 connection_id(0), |
| 152 view_id(0), | 152 view_id(0), |
| 153 view_id2(0), | 153 view_id2(0), |
| 154 view_id3(0), | 154 view_id3(0), |
| 155 event_action(mojo::EVENT_TYPE_UNKNOWN), | 155 event_action(mojo::EventType::UNKNOWN), |
| 156 direction(mojo::ORDER_DIRECTION_ABOVE), | 156 direction(mojo::OrderDirection::ABOVE), |
| 157 bool_value(false) { | 157 bool_value(false) { |
| 158 } | 158 } |
| 159 | 159 |
| 160 Change::~Change() { | 160 Change::~Change() { |
| 161 } | 161 } |
| 162 | 162 |
| 163 TestChangeTracker::TestChangeTracker() | 163 TestChangeTracker::TestChangeTracker() |
| 164 : delegate_(NULL) { | 164 : delegate_(NULL) { |
| 165 } | 165 } |
| 166 | 166 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 | 305 |
| 306 std::string TestView::ToString2() const { | 306 std::string TestView::ToString2() const { |
| 307 return base::StringPrintf("view=%s parent=%s visible=%s drawn=%s", | 307 return base::StringPrintf("view=%s parent=%s visible=%s drawn=%s", |
| 308 ViewIdToString(view_id).c_str(), | 308 ViewIdToString(view_id).c_str(), |
| 309 ViewIdToString(parent_id).c_str(), | 309 ViewIdToString(parent_id).c_str(), |
| 310 visible ? "true" : "false", | 310 visible ? "true" : "false", |
| 311 drawn ? "true" : "false"); | 311 drawn ? "true" : "false"); |
| 312 } | 312 } |
| 313 | 313 |
| 314 } // namespace view_manager | 314 } // namespace view_manager |
| OLD | NEW |