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

Side by Side Diff: chrome/browser/chromeos/login/user_manager.cc

Issue 6538098: [Chrome OS] Owner keys are generated outside Chrome now; handle appropriately (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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 | « chrome/browser/chromeos/login/ownership_service_unittest.cc ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/login/user_manager.h" 5 #include "chrome/browser/chromeos/login/user_manager.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 if (is_owner) { 136 if (is_owner) {
137 // Also update cached value. 137 // Also update cached value.
138 UserCrosSettingsProvider::UpdateCachedOwner( 138 UserCrosSettingsProvider::UpdateCachedOwner(
139 user_manager->logged_in_user().email()); 139 user_manager->logged_in_user().email());
140 } 140 }
141 } 141 }
142 142
143 // Checks current user's ownership on file thread. 143 // Checks current user's ownership on file thread.
144 void CheckOwnership() { 144 void CheckOwnership() {
145 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 145 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
146
147 bool is_owner = OwnershipService::GetSharedInstance()->CurrentUserIsOwner(); 146 bool is_owner = OwnershipService::GetSharedInstance()->CurrentUserIsOwner();
147 VLOG(1) << "Current user " << (is_owner ? "is owner" : "is not owner");
148 148
149 // UserManager should be accessed only on UI thread. 149 // UserManager should be accessed only on UI thread.
150 BrowserThread::PostTask( 150 BrowserThread::PostTask(
151 BrowserThread::UI, 151 BrowserThread::UI,
152 FROM_HERE, 152 FROM_HERE,
153 NewRunnableFunction(&UpdateOwnership, is_owner)); 153 NewRunnableFunction(&UpdateOwnership, is_owner));
154 } 154 }
155 155
156 } // namespace 156 } // namespace
157 157
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 void UserManager::Observe(NotificationType type, 468 void UserManager::Observe(NotificationType type,
469 const NotificationSource& source, 469 const NotificationSource& source,
470 const NotificationDetails& details) { 470 const NotificationDetails& details) {
471 if (type == NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) { 471 if (type == NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) {
472 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 472 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
473 NewRunnableFunction(&CheckOwnership)); 473 NewRunnableFunction(&CheckOwnership));
474 } 474 }
475 } 475 }
476 476
477 } // namespace chromeos 477 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/ownership_service_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698