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

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

Issue 8842002: Remove lock screen item from menu and disable screen lock on guest session. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | « no previous file | chrome/browser/ui/toolbar/wrench_menu_model_chromeos.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/screen_locker.h" 5 #include "chrome/browser/chromeos/login/screen_locker.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 chromeos::LoginStatusConsumer* consumer) { 344 chromeos::LoginStatusConsumer* consumer) {
345 login_status_consumer_ = consumer; 345 login_status_consumer_ = consumer;
346 } 346 }
347 347
348 // static 348 // static
349 void ScreenLocker::Show() { 349 void ScreenLocker::Show() {
350 VLOG(1) << "In ScreenLocker::Show"; 350 VLOG(1) << "In ScreenLocker::Show";
351 UserMetrics::RecordAction(UserMetricsAction("ScreenLocker_Show")); 351 UserMetrics::RecordAction(UserMetricsAction("ScreenLocker_Show"));
352 DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI); 352 DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI);
353 353
354 // Check whether the currently logged in user is a guest account and if so,
355 // refuse to lock the screen (crosbug.com/23764).
356 // TODO(flackr): We can allow lock screen for guest accounts when
357 // unlock_on_input is supported by the WebUI screen locker.
358 if (UserManager::Get()->logged_in_user().email().empty()) {
359 VLOG(1) << "Show: Refusing to lock screen for guest account.";
achuithb 2011/12/07 18:46:02 Could you please change this to DVLOG? And change
flackr 2011/12/07 19:05:55 Done.
360 return;
361 }
362
354 // Exit fullscreen. 363 // Exit fullscreen.
355 Browser* browser = BrowserList::GetLastActive(); 364 Browser* browser = BrowserList::GetLastActive();
356 // browser can be NULL if we receive a lock request before the first browser 365 // browser can be NULL if we receive a lock request before the first browser
357 // window is shown. 366 // window is shown.
358 if (browser && browser->window()->IsFullscreen()) { 367 if (browser && browser->window()->IsFullscreen()) {
359 browser->ToggleFullscreenMode(false); 368 browser->ToggleFullscreenMode(false);
360 } 369 }
361 370
362 if (!screen_locker_) { 371 if (!screen_locker_) {
363 VLOG(1) << "Show: Locking screen"; 372 VLOG(1) << "Show: Locking screen";
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 450
442 bool state = true; 451 bool state = true;
443 content::NotificationService::current()->Notify( 452 content::NotificationService::current()->Notify(
444 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, 453 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED,
445 content::Source<ScreenLocker>(this), 454 content::Source<ScreenLocker>(this),
446 content::Details<bool>(&state)); 455 content::Details<bool>(&state));
447 CrosLibrary::Get()->GetScreenLockLibrary()->NotifyScreenLockCompleted(); 456 CrosLibrary::Get()->GetScreenLockLibrary()->NotifyScreenLockCompleted();
448 } 457 }
449 458
450 } // namespace chromeos 459 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/toolbar/wrench_menu_model_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698