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 "components/mus/public/cpp/window.h" | 5 #include "components/mus/public/cpp/window.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 const std::vector<uint8_t>* new_data) override { | 784 const std::vector<uint8_t>* new_data) override { |
785 changes_.push_back(base::StringPrintf( | 785 changes_.push_back(base::StringPrintf( |
786 "window=%s shared property changed key=%s old_value=%s new_value=%s", | 786 "window=%s shared property changed key=%s old_value=%s new_value=%s", |
787 WindowIdToString(window->id()).c_str(), name.c_str(), | 787 WindowIdToString(window->id()).c_str(), name.c_str(), |
788 VectorToString(old_data).c_str(), VectorToString(new_data).c_str())); | 788 VectorToString(old_data).c_str(), VectorToString(new_data).c_str())); |
789 } | 789 } |
790 | 790 |
791 std::string VectorToString(const std::vector<uint8_t>* data) { | 791 std::string VectorToString(const std::vector<uint8_t>* data) { |
792 if (!data) | 792 if (!data) |
793 return "NULL"; | 793 return "NULL"; |
794 gfx::Size size = | 794 gfx::Size size = mojo::ConvertTo<gfx::Size>(*data); |
795 mojo::TypeConverter<gfx::Size, const std::vector<uint8_t>>::Convert( | |
796 *data); | |
797 return base::StringPrintf("%d,%d", size.width(), size.height()); | 795 return base::StringPrintf("%d,%d", size.width(), size.height()); |
798 } | 796 } |
799 | 797 |
800 Window* window_; | 798 Window* window_; |
801 Changes changes_; | 799 Changes changes_; |
802 | 800 |
803 DISALLOW_COPY_AND_ASSIGN(SharedPropertyChangeObserver); | 801 DISALLOW_COPY_AND_ASSIGN(SharedPropertyChangeObserver); |
804 }; | 802 }; |
805 | 803 |
806 } // namespace | 804 } // namespace |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 scoped_ptr<TestWindow> window0(CreateTestWindow(1, parent.get())); | 1124 scoped_ptr<TestWindow> window0(CreateTestWindow(1, parent.get())); |
1127 scoped_ptr<TestWindow> window1(CreateTestWindow(2, parent.get())); | 1125 scoped_ptr<TestWindow> window1(CreateTestWindow(2, parent.get())); |
1128 | 1126 |
1129 TestWindow* window2 = CreateTestWindow(3, parent.get()); | 1127 TestWindow* window2 = CreateTestWindow(3, parent.get()); |
1130 | 1128 |
1131 window0->AddTransientWindow(window2); | 1129 window0->AddTransientWindow(window2); |
1132 EXPECT_EQ("1 3 2", ChildWindowIDsAsString(parent.get())); | 1130 EXPECT_EQ("1 3 2", ChildWindowIDsAsString(parent.get())); |
1133 } | 1131 } |
1134 | 1132 |
1135 } // namespace mus | 1133 } // namespace mus |
OLD | NEW |