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

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

Issue 10827203: Deselect should maintain previously selected wallpaper and guest should load default guest wallpaper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 8 years, 4 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/wallpaper_manager.h ('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) 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/wallpaper_manager.h" 5 #include "chrome/browser/chromeos/login/wallpaper_manager.h"
6 6
7 #include "ash/desktop_background/desktop_background_controller.h" 7 #include "ash/desktop_background/desktop_background_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 wallpaper_update->SetWithoutPathExpansion(username, wallpaper_properties); 352 wallpaper_update->SetWithoutPathExpansion(username, wallpaper_properties);
353 } 353 }
354 354
355 void WallpaperManager::SetLastSelectedUser( 355 void WallpaperManager::SetLastSelectedUser(
356 const std::string& last_selected_user) { 356 const std::string& last_selected_user) {
357 last_selected_user_ = last_selected_user; 357 last_selected_user_ = last_selected_user;
358 } 358 }
359 359
360 void WallpaperManager::SetUserWallpaper(const std::string& email) { 360 void WallpaperManager::SetUserWallpaper(const std::string& email) {
361 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 361 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
362 if (email == kGuestUser) {
363 ash::Shell::GetInstance()->desktop_background_controller()->
364 SetDefaultWallpaper(ash::GetGuestWallpaperIndex(), false);
365
Nikita (slow) 2012/08/08 16:51:25 nit: drop empty line.
366 }
367
362 if (!UserManager::Get()->IsKnownUser(email)) 368 if (!UserManager::Get()->IsKnownUser(email))
363 return; 369 return;
364 370
365 User::WallpaperType type; 371 User::WallpaperType type;
366 int index; 372 int index;
367 base::Time date; 373 base::Time date;
368 GetUserWallpaperProperties(email, &type, &index, &date); 374 GetUserWallpaperProperties(email, &type, &index, &date);
369 if (type == User::DAILY && date != base::Time::Now().LocalMidnight()) { 375 if (type == User::DAILY && date != base::Time::Now().LocalMidnight()) {
370 index = ash::GetNextWallpaperIndex(index); 376 index = ash::GetNextWallpaperIndex(index);
371 SaveUserWallpaperProperties(email, User::DAILY, index); 377 SaveUserWallpaperProperties(email, User::DAILY, index);
(...skipping 15 matching lines...) Expand all
387 SetLastSelectedUser(email); 393 SetLastSelectedUser(email);
388 } 394 }
389 395
390 void WallpaperManager::SetWallpaperFromImageSkia( 396 void WallpaperManager::SetWallpaperFromImageSkia(
391 const gfx::ImageSkia& wallpaper, 397 const gfx::ImageSkia& wallpaper,
392 ash::WallpaperLayout layout) { 398 ash::WallpaperLayout layout) {
393 ash::Shell::GetInstance()->desktop_background_controller()-> 399 ash::Shell::GetInstance()->desktop_background_controller()->
394 SetCustomWallpaper(wallpaper, layout); 400 SetCustomWallpaper(wallpaper, layout);
395 } 401 }
396 402
397 void WallpaperManager::OnUserDeselected() {
398 if (!UserManager::Get()->IsUserLoggedIn()) {
399 // This will set default login wallpaper (#fefefe).
400 ash::Shell::GetInstance()->desktop_background_controller()->
401 SetDefaultWallpaper(ash::GetSolidColorIndex(), false);
402 }
403 }
404
405 void WallpaperManager::OnUserSelected(const std::string& email) { 403 void WallpaperManager::OnUserSelected(const std::string& email) {
406 SetUserWallpaper(email); 404 SetUserWallpaper(email);
407 } 405 }
408 406
409 // WallpaperManager, private: -------------------------------------------------- 407 // WallpaperManager, private: --------------------------------------------------
410 408
411 WallpaperManager::~WallpaperManager() { 409 WallpaperManager::~WallpaperManager() {
412 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); 410 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this);
413 system::TimezoneSettings::GetInstance()->RemoveObserver(this); 411 system::TimezoneSettings::GetInstance()->RemoveObserver(this);
414 } 412 }
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 593
596 void WallpaperManager::SystemResumed() { 594 void WallpaperManager::SystemResumed() {
597 BatchUpdateWallpaper(); 595 BatchUpdateWallpaper();
598 } 596 }
599 597
600 void WallpaperManager::TimezoneChanged(const icu::TimeZone& timezone) { 598 void WallpaperManager::TimezoneChanged(const icu::TimeZone& timezone) {
601 RestartTimer(); 599 RestartTimer();
602 } 600 }
603 601
604 } // chromeos 602 } // chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/wallpaper_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698