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

Unified Diff: ash/desktop_background/desktop_background_controller.cc

Issue 1984433002: Hook up Chrome's wallpaper picker for mash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/mus/BUILD.gn » ('j') | ash/mus/user_wallpaper_delegate_mus.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/desktop_background/desktop_background_controller.cc
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc
index a40974dcaf8174b084f175d032da0f561aa01099..617cf9bdc7062745b797ce7f93520bc5c1620914 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -165,13 +165,18 @@ gfx::Size DesktopBackgroundController::GetMaxDisplaySizeInNative() {
int height = 0;
std::vector<display::Display> displays =
display::Screen::GetScreen()->GetAllDisplays();
- DisplayManager* display_manager = Shell::GetInstance()->display_manager();
+ DisplayManager* display_manager =
+ Shell::HasInstance() ? Shell::GetInstance()->display_manager() : nullptr;
for (std::vector<display::Display>::iterator iter = displays.begin();
iter != displays.end(); ++iter) {
// Don't use size_in_pixel because we want to use the native pixel size.
- gfx::Size size_in_pixel =
- display_manager->GetDisplayInfo(iter->id()).bounds_in_native().size();
+ // TODO(msw): Fix this for Mash/Mus.
+ gfx::Size size_in_pixel = display_manager
+ ? display_manager->GetDisplayInfo(iter->id())
+ .bounds_in_native()
+ .size()
+ : iter->size();
if (iter->rotation() == display::Display::ROTATE_90 ||
iter->rotation() == display::Display::ROTATE_270) {
size_in_pixel = gfx::Size(size_in_pixel.height(), size_in_pixel.width());
« no previous file with comments | « no previous file | ash/mus/BUILD.gn » ('j') | ash/mus/user_wallpaper_delegate_mus.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698