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

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

Issue 2413503002: Cleanup mojo Wallpaper interfaces for mash. (Closed)
Patch Set: Cleanup. Created 4 years, 2 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_wallpaper_delegate.h" 5 #include "chrome/browser/chromeos/background/ash_wallpaper_delegate.h"
6 6
7 #include "ash/common/wallpaper/wallpaper_delegate.h" 7 #include "ash/common/wallpaper/wallpaper_delegate.h"
8 #include "ash/common/wm/window_animation_types.h" 8 #include "ash/common/wm/window_animation_types.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/window_animations.h" 10 #include "ash/wm/window_animations.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 80
81 void UpdateWallpaper(bool clear_cache) override { 81 void UpdateWallpaper(bool clear_cache) override {
82 chromeos::WallpaperManager::Get()->UpdateWallpaper(clear_cache); 82 chromeos::WallpaperManager::Get()->UpdateWallpaper(clear_cache);
83 } 83 }
84 84
85 void InitializeWallpaper() override { 85 void InitializeWallpaper() override {
86 chromeos::WallpaperManager::Get()->InitializeWallpaper(); 86 chromeos::WallpaperManager::Get()->InitializeWallpaper();
87 } 87 }
88 88
89 void OpenSetWallpaperPage() override {
90 if (CanOpenSetWallpaperPage())
91 wallpaper_manager_util::OpenWallpaperManager();
92 }
93
94 bool CanOpenSetWallpaperPage() override { 89 bool CanOpenSetWallpaperPage() override {
95 const LoginState* login_state = LoginState::Get(); 90 const LoginState* login_state = LoginState::Get();
96 const LoginState::LoggedInUserType user_type = 91 const LoginState::LoggedInUserType user_type =
97 login_state->GetLoggedInUserType(); 92 login_state->GetLoggedInUserType();
98 if (!login_state->IsUserLoggedIn()) 93 if (!login_state->IsUserLoggedIn())
99 return false; 94 return false;
100 95
101 // Whitelist user types that are allowed to change their wallpaper. (Guest 96 // Whitelist user types that are allowed to change their wallpaper. (Guest
102 // users are not, see crosbug 26900.) 97 // users are not, see crosbug 26900.)
103 if (user_type != LoginState::LOGGED_IN_USER_REGULAR && 98 if (user_type != LoginState::LOGGED_IN_USER_REGULAR &&
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 DISALLOW_COPY_AND_ASSIGN(WallpaperDelegate); 132 DISALLOW_COPY_AND_ASSIGN(WallpaperDelegate);
138 }; 133 };
139 134
140 } // namespace 135 } // namespace
141 136
142 ash::WallpaperDelegate* CreateWallpaperDelegate() { 137 ash::WallpaperDelegate* CreateWallpaperDelegate() {
143 return new chromeos::WallpaperDelegate(); 138 return new chromeos::WallpaperDelegate();
144 } 139 }
145 140
146 } // namespace chromeos 141 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698