| 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 "ash/shell.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 aura::Window* lost_active) { | 1210 aura::Window* lost_active) { |
| 1211 if (gained_active) | 1211 if (gained_active) |
| 1212 root_window_for_new_windows_ = gained_active->GetRootWindow(); | 1212 root_window_for_new_windows_ = gained_active->GetRootWindow(); |
| 1213 } | 1213 } |
| 1214 | 1214 |
| 1215 void Shell::OnSessionStateChanged(session_manager::SessionState state) { | 1215 void Shell::OnSessionStateChanged(session_manager::SessionState state) { |
| 1216 // Initialize the shelf when a session becomes active. It's safe to do this | 1216 // Initialize the shelf when a session becomes active. It's safe to do this |
| 1217 // multiple times (e.g. initial login vs. multiprofile add session). | 1217 // multiple times (e.g. initial login vs. multiprofile add session). |
| 1218 if (state == session_manager::SessionState::ACTIVE) { | 1218 if (state == session_manager::SessionState::ACTIVE) { |
| 1219 InitializeShelf(); | 1219 InitializeShelf(); |
| 1220 } |
| 1221 // Recreates keyboard on user profile change, to refresh keyboard |
| 1222 // extensions with the new profile and the extensions call proper IME. |
| 1223 // |LOGGED_IN_NOT_ACTIVE| is needed so that the virtual keyboard works on |
| 1224 // supervised user creation. crbug.com/712873 |
| 1225 // |ACTIVE| is also needed for guest user workflow. |
| 1226 if ((state == session_manager::SessionState::LOGGED_IN_NOT_ACTIVE || |
| 1227 state == session_manager::SessionState::ACTIVE) && |
| 1228 keyboard::IsKeyboardEnabled() && |
| 1229 !keyboard::KeyboardController::GetInstance()) { |
| 1220 if (GetAshConfig() != Config::MASH) { | 1230 if (GetAshConfig() != Config::MASH) { |
| 1221 // Recreate the keyboard after initial login and after multiprofile login. | 1231 // Recreate the keyboard after initial login and after multiprofile login. |
| 1222 CreateKeyboard(); | 1232 CreateKeyboard(); |
| 1223 } | 1233 } |
| 1224 } | 1234 } |
| 1225 } | 1235 } |
| 1226 | 1236 |
| 1227 void Shell::OnLoginStatusChanged(LoginStatus login_status) { | 1237 void Shell::OnLoginStatusChanged(LoginStatus login_status) { |
| 1228 UpdateAfterLoginStatusChange(login_status); | 1238 UpdateAfterLoginStatusChange(login_status); |
| 1229 } | 1239 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1259 void Shell::OnPrefServiceInitialized( | 1269 void Shell::OnPrefServiceInitialized( |
| 1260 std::unique_ptr<::PrefService> pref_service) { | 1270 std::unique_ptr<::PrefService> pref_service) { |
| 1261 if (!instance_) | 1271 if (!instance_) |
| 1262 return; | 1272 return; |
| 1263 // |pref_service_| is null if can't connect to Chrome (as happens when | 1273 // |pref_service_| is null if can't connect to Chrome (as happens when |
| 1264 // running mash outside of chrome --mash and chrome isn't built). | 1274 // running mash outside of chrome --mash and chrome isn't built). |
| 1265 pref_service_ = std::move(pref_service); | 1275 pref_service_ = std::move(pref_service); |
| 1266 } | 1276 } |
| 1267 | 1277 |
| 1268 } // namespace ash | 1278 } // namespace ash |
| OLD | NEW |