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

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

Issue 9353010: Add FullscreenController::ToggleFullscreenModeWithExtension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Small style fix Created 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 if (UserManager::Get()->logged_in_user().email().empty()) { 352 if (UserManager::Get()->logged_in_user().email().empty()) {
353 DVLOG(1) << "Show: Refusing to lock screen for guest account."; 353 DVLOG(1) << "Show: Refusing to lock screen for guest account.";
354 return; 354 return;
355 } 355 }
356 356
357 // Exit fullscreen. 357 // Exit fullscreen.
358 Browser* browser = BrowserList::GetLastActive(); 358 Browser* browser = BrowserList::GetLastActive();
359 // browser can be NULL if we receive a lock request before the first browser 359 // browser can be NULL if we receive a lock request before the first browser
360 // window is shown. 360 // window is shown.
361 if (browser && browser->window()->IsFullscreen()) { 361 if (browser && browser->window()->IsFullscreen()) {
362 browser->ToggleFullscreenMode(false); 362 browser->ToggleFullscreenMode();
363 } 363 }
364 364
365 if (!screen_locker_) { 365 if (!screen_locker_) {
366 DVLOG(1) << "Show: Locking screen"; 366 DVLOG(1) << "Show: Locking screen";
367 ScreenLocker* locker = 367 ScreenLocker* locker =
368 new ScreenLocker(UserManager::Get()->logged_in_user()); 368 new ScreenLocker(UserManager::Get()->logged_in_user());
369 locker->Init(); 369 locker->Init();
370 } else { 370 } else {
371 // PowerManager re-sends lock screen signal if it doesn't 371 // PowerManager re-sends lock screen signal if it doesn't
372 // receive the response within timeout. Just send complete 372 // receive the response within timeout. Just send complete
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 bool state = true; 439 bool state = true;
440 content::NotificationService::current()->Notify( 440 content::NotificationService::current()->Notify(
441 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, 441 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED,
442 content::Source<ScreenLocker>(this), 442 content::Source<ScreenLocker>(this),
443 content::Details<bool>(&state)); 443 content::Details<bool>(&state));
444 DBusThreadManager::Get()->GetPowerManagerClient()-> 444 DBusThreadManager::Get()->GetPowerManagerClient()->
445 NotifyScreenLockCompleted(); 445 NotifyScreenLockCompleted();
446 } 446 }
447 447
448 } // namespace chromeos 448 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698