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

Side by Side Diff: chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc

Issue 13671005: Re-apply 192420: Move login switches to src/chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/background/ash_user_wallpaper_delegate.h" 5 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/desktop_background/user_wallpaper_delegate.h" 8 #include "ash/desktop_background/user_wallpaper_delegate.h"
9 #include "ash/wm/window_animations.h" 9 #include "ash/wm/window_animations.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "chrome/browser/chromeos/extensions/wallpaper_manager_util.h" 12 #include "chrome/browser/chromeos/extensions/wallpaper_manager_util.h"
13 #include "chrome/browser/chromeos/login/user_manager.h" 13 #include "chrome/browser/chromeos/login/user_manager.h"
14 #include "chrome/browser/chromeos/login/wallpaper_manager.h" 14 #include "chrome/browser/chromeos/login/wallpaper_manager.h"
15 #include "chrome/browser/chromeos/login/wizard_controller.h" 15 #include "chrome/browser/chromeos/login/wizard_controller.h"
16 #include "chrome/browser/profiles/profile_manager.h" 16 #include "chrome/browser/profiles/profile_manager.h"
17 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
18 #include "chrome/browser/ui/browser_finder.h" 18 #include "chrome/browser/ui/browser_finder.h"
19 #include "chrome/browser/ui/chrome_pages.h" 19 #include "chrome/browser/ui/chrome_pages.h"
20 #include "chrome/common/chrome_notification_types.h" 20 #include "chrome/common/chrome_notification_types.h"
21 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
22 #include "chromeos/chromeos_switches.h"
22 #include "content/public/browser/notification_service.h" 23 #include "content/public/browser/notification_service.h"
23 24
24 namespace chromeos { 25 namespace chromeos {
25 26
26 namespace { 27 namespace {
27 28
28 bool IsNormalWallpaperChange() { 29 bool IsNormalWallpaperChange() {
29 if (chromeos::UserManager::Get()->IsUserLoggedIn() || 30 if (chromeos::UserManager::Get()->IsUserLoggedIn() ||
30 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kFirstBoot) || 31 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kFirstBoot) ||
31 WizardController::IsZeroDelayEnabled() || 32 WizardController::IsZeroDelayEnabled() ||
(...skipping 21 matching lines...) Expand all
53 virtual bool ShouldShowInitialAnimation() OVERRIDE { 54 virtual bool ShouldShowInitialAnimation() OVERRIDE {
54 if (IsNormalWallpaperChange() || boot_animation_finished_) 55 if (IsNormalWallpaperChange() || boot_animation_finished_)
55 return false; 56 return false;
56 57
57 // It is a first boot case now. If kDisableBootAnimation flag 58 // It is a first boot case now. If kDisableBootAnimation flag
58 // is passed, it only disables any transition after OOBE. 59 // is passed, it only disables any transition after OOBE.
59 // |kDisableOobeAnimation| disables OOBE animation for slow hardware. 60 // |kDisableOobeAnimation| disables OOBE animation for slow hardware.
60 bool is_registered = WizardController::IsDeviceRegistered(); 61 bool is_registered = WizardController::IsDeviceRegistered();
61 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 62 const CommandLine* command_line = CommandLine::ForCurrentProcess();
62 bool disable_boot_animation = command_line-> 63 bool disable_boot_animation = command_line->
63 HasSwitch(switches::kDisableBootAnimation); 64 HasSwitch(::switches::kDisableBootAnimation);
64 bool disable_oobe_animation = command_line-> 65 bool disable_oobe_animation = command_line->
65 HasSwitch(switches::kDisableOobeAnimation); 66 HasSwitch(::switches::kDisableOobeAnimation);
66 if ((!is_registered && disable_oobe_animation) || 67 if ((!is_registered && disable_oobe_animation) ||
67 (is_registered && disable_boot_animation)) 68 (is_registered && disable_boot_animation))
68 return false; 69 return false;
69 70
70 return true; 71 return true;
71 } 72 }
72 73
73 virtual void UpdateWallpaper() OVERRIDE { 74 virtual void UpdateWallpaper() OVERRIDE {
74 chromeos::WallpaperManager::Get()->UpdateWallpaper(); 75 chromeos::WallpaperManager::Get()->UpdateWallpaper();
75 } 76 }
(...skipping 28 matching lines...) Expand all
104 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); 105 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate);
105 }; 106 };
106 107
107 } // namespace 108 } // namespace
108 109
109 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { 110 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() {
110 return new chromeos::UserWallpaperDelegate(); 111 return new chromeos::UserWallpaperDelegate();
111 } 112 }
112 113
113 } // namespace chromeos 114 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698