Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: components/user_manager/user_manager.h

Issue 2661283002: cros: Clean up SessionStateDelegate refs in Chrome (Closed)
Patch Set: update browser_finder_chromeos_unittest Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef COMPONENTS_USER_MANAGER_USER_MANAGER_H_ 5 #ifndef COMPONENTS_USER_MANAGER_USER_MANAGER_H_
6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_H_ 6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // Called when the profile image for the given user is downloaded. 49 // Called when the profile image for the given user is downloaded.
50 // |profile_image| contains the downloaded profile image. 50 // |profile_image| contains the downloaded profile image.
51 virtual void OnUserProfileImageUpdated(const User& user, 51 virtual void OnUserProfileImageUpdated(const User& user,
52 const gfx::ImageSkia& profile_image); 52 const gfx::ImageSkia& profile_image);
53 53
54 protected: 54 protected:
55 virtual ~Observer(); 55 virtual ~Observer();
56 }; 56 };
57 57
58 // TODO(nkostylev): Refactor and move this observer out of UserManager. 58 // TODO(xiyuan): Refactor and move this observer out of UserManager.
59 // Observer interface that defines methods used to notify on user session / 59 // Observer interface that defines methods used to notify on user session /
60 // active user state changes. Default implementation is empty. 60 // active user state changes. Default implementation is empty.
61 class UserSessionStateObserver { 61 class UserSessionStateObserver {
62 public: 62 public:
63 // Called when active user has changed. 63 // Called when active user has changed.
64 virtual void ActiveUserChanged(const User* active_user); 64 virtual void ActiveUserChanged(const User* active_user);
65 65
66 // Called when another user got added to the existing session. 66 // Called when another user got added to the existing session.
67 virtual void UserAddedToSession(const User* added_user); 67 virtual void UserAddedToSession(const User* added_user);
68 68
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 friend class chromeos::ScopedUserManagerEnabler; 388 friend class chromeos::ScopedUserManagerEnabler;
389 389
390 // Same as Get() but doesn't won't crash is current instance is NULL. 390 // Same as Get() but doesn't won't crash is current instance is NULL.
391 static UserManager* GetForTesting(); 391 static UserManager* GetForTesting();
392 392
393 // Sets UserManager instance to the given |user_manager|. 393 // Sets UserManager instance to the given |user_manager|.
394 // Returns the previous value of the instance. 394 // Returns the previous value of the instance.
395 static UserManager* SetForTesting(UserManager* user_manager); 395 static UserManager* SetForTesting(UserManager* user_manager);
396 }; 396 };
397 397
398 // TODO(xiyuan): Move this along with UserSessionStateObserver
399 class USER_MANAGER_EXPORT ScopedUserSessionStateObserver {
400 public:
401 explicit ScopedUserSessionStateObserver(
402 UserManager::UserSessionStateObserver* observer);
403 ~ScopedUserSessionStateObserver();
404
405 private:
406 UserManager::UserSessionStateObserver* const observer_;
407
408 DISALLOW_COPY_AND_ASSIGN(ScopedUserSessionStateObserver);
409 };
410
398 } // namespace user_manager 411 } // namespace user_manager
399 412
400 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_H_ 413 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc ('k') | components/user_manager/user_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698