OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/display/display_preferences.h" | 5 #include "chrome/browser/chromeos/display/display_preferences.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 std::unique_ptr<base::DictionaryValue> layout_value( | 146 std::unique_ptr<base::DictionaryValue> layout_value( |
147 new base::DictionaryValue()); | 147 new base::DictionaryValue()); |
148 layout_value->SetBoolean(key, value != nullptr); | 148 layout_value->SetBoolean(key, value != nullptr); |
149 pref_data->Set(name, layout_value.release()); | 149 pref_data->Set(name, layout_value.release()); |
150 } | 150 } |
151 } | 151 } |
152 | 152 |
153 void StoreDisplayBoolPropertyForList(const display::DisplayIdList& list, | 153 void StoreDisplayBoolPropertyForList(const display::DisplayIdList& list, |
154 const std::string& key, | 154 const std::string& key, |
155 bool value) { | 155 bool value) { |
156 StoreDisplayPropertyForList( | 156 StoreDisplayPropertyForList(list, key, |
157 list, key, base::MakeUnique<base::FundamentalValue>(value)); | 157 base::MakeUnique<base::Value>(value)); |
158 } | 158 } |
159 | 159 |
160 void StoreDisplayLayoutPrefForList(const display::DisplayIdList& list, | 160 void StoreDisplayLayoutPrefForList(const display::DisplayIdList& list, |
161 display::DisplayPlacement::Position layout, | 161 display::DisplayPlacement::Position layout, |
162 int offset) { | 162 int offset) { |
163 StoreDisplayLayoutPrefForList(list, layout, offset, list[0]); | 163 StoreDisplayLayoutPrefForList(list, layout, offset, list[0]); |
164 } | 164 } |
165 | 165 |
166 void StoreDisplayOverscan(int64_t id, const gfx::Insets& insets) { | 166 void StoreDisplayOverscan(int64_t id, const gfx::Insets& insets) { |
167 DictionaryPrefUpdate update(&local_state_, prefs::kDisplayProperties); | 167 DictionaryPrefUpdate update(&local_state_, prefs::kDisplayProperties); |
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 | 1118 |
1119 EXPECT_EQ(gfx::Rect(0, 0, 200, 200), | 1119 EXPECT_EQ(gfx::Rect(0, 0, 200, 200), |
1120 display_manager()->GetDisplayForId(list[0]).bounds()); | 1120 display_manager()->GetDisplayForId(list[0]).bounds()); |
1121 EXPECT_EQ(gfx::Rect(-200, 0, 200, 200), | 1121 EXPECT_EQ(gfx::Rect(-200, 0, 200, 200), |
1122 display_manager()->GetDisplayForId(list[1]).bounds()); | 1122 display_manager()->GetDisplayForId(list[1]).bounds()); |
1123 EXPECT_EQ(gfx::Rect(-100, 200, 300, 300), | 1123 EXPECT_EQ(gfx::Rect(-100, 200, 300, 300), |
1124 display_manager()->GetDisplayForId(list[2]).bounds()); | 1124 display_manager()->GetDisplayForId(list[2]).bounds()); |
1125 } | 1125 } |
1126 | 1126 |
1127 } // namespace chromeos | 1127 } // namespace chromeos |
OLD | NEW |