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

Side by Side Diff: chromeos/login/login_state.cc

Issue 242983004: Disable some API calls in networkingPrivate for non-primary user (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chromeos/login/login_state.h ('k') | chromeos/login/login_state_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chromeos/login/login_state.h" 5 #include "chromeos/login/login_state.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/sys_info.h" 9 #include "base/sys_info.h"
10 #include "chromeos/chromeos_switches.h" 10 #include "chromeos/chromeos_switches.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 51
52 void LoginState::AddObserver(Observer* observer) { 52 void LoginState::AddObserver(Observer* observer) {
53 observer_list_.AddObserver(observer); 53 observer_list_.AddObserver(observer);
54 } 54 }
55 55
56 void LoginState::RemoveObserver(Observer* observer) { 56 void LoginState::RemoveObserver(Observer* observer) {
57 observer_list_.RemoveObserver(observer); 57 observer_list_.RemoveObserver(observer);
58 } 58 }
59 59
60 void LoginState::SetLoggedInStateAndPrimaryUser(
61 LoggedInState state,
62 LoggedInUserType type,
63 const std::string& primary_user_hash) {
64 DCHECK(type != LOGGED_IN_USER_NONE);
65 primary_user_hash_ = primary_user_hash;
66 VLOG(1) << "LoggedInStateUser: " << primary_user_hash;
67 SetLoggedInState(state, type);
68 }
69
60 void LoginState::SetLoggedInState(LoggedInState state, 70 void LoginState::SetLoggedInState(LoggedInState state,
61 LoggedInUserType type) { 71 LoggedInUserType type) {
62 if (state == logged_in_state_ && type == logged_in_user_type_) 72 if (state == logged_in_state_ && type == logged_in_user_type_)
63 return; 73 return;
64 VLOG(1) << "LoggedInState: " << state << " UserType: " << type; 74 VLOG(1) << "LoggedInState: " << state << " UserType: " << type;
65 logged_in_state_ = state; 75 logged_in_state_ = state;
66 logged_in_user_type_ = type; 76 logged_in_user_type_ = type;
67 NotifyObservers(); 77 NotifyObservers();
68 } 78 }
69 79
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 142
133 LoginState::~LoginState() { 143 LoginState::~LoginState() {
134 } 144 }
135 145
136 void LoginState::NotifyObservers() { 146 void LoginState::NotifyObservers() {
137 FOR_EACH_OBSERVER(LoginState::Observer, observer_list_, 147 FOR_EACH_OBSERVER(LoginState::Observer, observer_list_,
138 LoggedInStateChanged()); 148 LoggedInStateChanged());
139 } 149 }
140 150
141 } // namespace chromeos 151 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/login/login_state.h ('k') | chromeos/login/login_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698