assistant_state_controller.cc 935 B

123456789101112131415161718192021222324252627
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ash/assistant/assistant_state_controller.h"
  5. #include "ash/session/session_controller_impl.h"
  6. #include "ash/shell.h"
  7. namespace ash {
  8. AssistantStateController::AssistantStateController()
  9. : session_observer_(this) {}
  10. AssistantStateController::~AssistantStateController() = default;
  11. void AssistantStateController::OnActiveUserPrefServiceChanged(
  12. PrefService* pref_service) {
  13. // For non-primary prefs, calling the method with nullptr will reset the
  14. // current registry.
  15. PrefService* primary_user_prefs =
  16. Shell::Get()->session_controller()->GetPrimaryUserPrefService();
  17. RegisterPrefChanges(primary_user_prefs == pref_service ? primary_user_prefs
  18. : nullptr);
  19. }
  20. } // namespace ash