| 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 "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 LOG(WARNING) << "Can't convert the data into insets for " << *it; | 140 LOG(WARNING) << "Can't convert the data into insets for " << *it; |
| 141 continue; | 141 continue; |
| 142 } | 142 } |
| 143 | 143 |
| 144 display_controller->SetOverscanInsets(display_id, insets); | 144 display_controller->SetOverscanInsets(display_id, insets); |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace | 148 } // namespace |
| 149 | 149 |
| 150 void RegisterDisplayLocalStatePrefs(PrefService* local_state) { | 150 void RegisterDisplayLocalStatePrefs(PrefServiceSimple* local_state) { |
| 151 // The default secondary display layout. | 151 // The default secondary display layout. |
| 152 local_state->RegisterIntegerPref(prefs::kSecondaryDisplayLayout, | 152 local_state->RegisterIntegerPref(prefs::kSecondaryDisplayLayout, |
| 153 static_cast<int>(ash::DisplayLayout::RIGHT), | 153 static_cast<int>(ash::DisplayLayout::RIGHT)); |
| 154 PrefService::UNSYNCABLE_PREF); | |
| 155 // The default offset of the secondary display position from the primary | 154 // The default offset of the secondary display position from the primary |
| 156 // display. | 155 // display. |
| 157 local_state->RegisterIntegerPref(prefs::kSecondaryDisplayOffset, | 156 local_state->RegisterIntegerPref(prefs::kSecondaryDisplayOffset, 0); |
| 158 0, | |
| 159 PrefService::UNSYNCABLE_PREF); | |
| 160 // Per-display preference. | 157 // Per-display preference. |
| 161 local_state->RegisterDictionaryPref(prefs::kSecondaryDisplays, | 158 local_state->RegisterDictionaryPref(prefs::kSecondaryDisplays); |
| 162 PrefService::UNSYNCABLE_PREF); | |
| 163 | 159 |
| 164 // Primary output name. | 160 // Primary output name. |
| 165 local_state->RegisterInt64Pref(prefs::kPrimaryDisplayID, | 161 local_state->RegisterInt64Pref(prefs::kPrimaryDisplayID, |
| 166 gfx::Display::kInvalidDisplayID, | 162 gfx::Display::kInvalidDisplayID); |
| 167 PrefService::UNSYNCABLE_PREF); | |
| 168 | 163 |
| 169 // Display overscan preference. | 164 // Display overscan preference. |
| 170 local_state->RegisterDictionaryPref(prefs::kDisplayOverscans, | 165 local_state->RegisterDictionaryPref(prefs::kDisplayOverscans); |
| 171 PrefService::UNSYNCABLE_PREF); | |
| 172 } | 166 } |
| 173 | 167 |
| 174 void SetDisplayLayoutPref(const gfx::Display& display, | 168 void SetDisplayLayoutPref(const gfx::Display& display, |
| 175 int layout, | 169 int layout, |
| 176 int offset) { | 170 int offset) { |
| 177 PrefService* local_state = g_browser_process->local_state(); | 171 PrefService* local_state = g_browser_process->local_state(); |
| 178 | 172 |
| 179 { | 173 { |
| 180 DictionaryPrefUpdate update(local_state, prefs::kSecondaryDisplays); | 174 DictionaryPrefUpdate update(local_state, prefs::kSecondaryDisplays); |
| 181 ash::DisplayLayout display_layout( | 175 ash::DisplayLayout display_layout( |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 | 235 |
| 242 void NotifyDisplayLocalStatePrefChanged() { | 236 void NotifyDisplayLocalStatePrefChanged() { |
| 243 PrefService* local_state = g_browser_process->local_state(); | 237 PrefService* local_state = g_browser_process->local_state(); |
| 244 NotifyDisplayLayoutChanged(); | 238 NotifyDisplayLayoutChanged(); |
| 245 ash::Shell::GetInstance()->display_controller()->SetPrimaryDisplayId( | 239 ash::Shell::GetInstance()->display_controller()->SetPrimaryDisplayId( |
| 246 local_state->GetInt64(prefs::kPrimaryDisplayID)); | 240 local_state->GetInt64(prefs::kPrimaryDisplayID)); |
| 247 NotifyDisplayOverscans(); | 241 NotifyDisplayOverscans(); |
| 248 } | 242 } |
| 249 | 243 |
| 250 } // namespace chromeos | 244 } // namespace chromeos |
| OLD | NEW |