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

Side by Side Diff: ash/desktop_background/desktop_background_controller.cc

Issue 12746002: Re-implement overscan & Implement Display Rotation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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 | « ash/ash.gyp ('k') | ash/display/display_controller.cc » ('j') | 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 "ash/desktop_background/desktop_background_controller.h" 5 #include "ash/desktop_background/desktop_background_controller.h"
6 6
7 #include "ash/desktop_background/desktop_background_controller_observer.h" 7 #include "ash/desktop_background/desktop_background_controller_observer.h"
8 #include "ash/desktop_background/desktop_background_view.h" 8 #include "ash/desktop_background/desktop_background_view.h"
9 #include "ash/desktop_background/desktop_background_widget_controller.h" 9 #include "ash/desktop_background/desktop_background_widget_controller.h"
10 #include "ash/desktop_background/user_wallpaper_delegate.h" 10 #include "ash/desktop_background/user_wallpaper_delegate.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 current_wallpaper_.reset(NULL); 243 current_wallpaper_.reset(NULL);
244 SetDesktopBackgroundImageMode(); 244 SetDesktopBackgroundImageMode();
245 } 245 }
246 246
247 WallpaperResolution DesktopBackgroundController::GetAppropriateResolution() { 247 WallpaperResolution DesktopBackgroundController::GetAppropriateResolution() {
248 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 248 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
249 WallpaperResolution resolution = WALLPAPER_RESOLUTION_SMALL; 249 WallpaperResolution resolution = WALLPAPER_RESOLUTION_SMALL;
250 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); 250 Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
251 for (Shell::RootWindowList::iterator iter = root_windows.begin(); 251 for (Shell::RootWindowList::iterator iter = root_windows.begin();
252 iter != root_windows.end(); ++iter) { 252 iter != root_windows.end(); ++iter) {
253 gfx::Size root_window_size = (*iter)->GetHostSize(); 253 // Compare to host size as constants are defined in terms of
254 if (root_window_size.width() > kSmallWallpaperMaxWidth || 254 // physical pixel size.
255 root_window_size.height() > kSmallWallpaperMaxHeight) { 255 // TODO(oshima): This may not be ideal for fractional scaling
256 // scenario. Revisit and fix if necessary.
257 gfx::Size host_window_size = (*iter)->GetHostSize();
258 if (host_window_size.width() > kSmallWallpaperMaxWidth ||
259 host_window_size.height() > kSmallWallpaperMaxHeight) {
256 resolution = WALLPAPER_RESOLUTION_LARGE; 260 resolution = WALLPAPER_RESOLUTION_LARGE;
257 } 261 }
258 } 262 }
259 return resolution; 263 return resolution;
260 } 264 }
261 265
262 bool DesktopBackgroundController::MoveDesktopToLockedContainer() { 266 bool DesktopBackgroundController::MoveDesktopToLockedContainer() {
263 if (locked_) 267 if (locked_)
264 return false; 268 return false;
265 locked_ = true; 269 locked_ = true;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 } 404 }
401 return moved; 405 return moved;
402 } 406 }
403 407
404 int DesktopBackgroundController::GetBackgroundContainerId(bool locked) { 408 int DesktopBackgroundController::GetBackgroundContainerId(bool locked) {
405 return locked ? internal::kShellWindowId_LockScreenBackgroundContainer : 409 return locked ? internal::kShellWindowId_LockScreenBackgroundContainer :
406 internal::kShellWindowId_DesktopBackgroundContainer; 410 internal::kShellWindowId_DesktopBackgroundContainer;
407 } 411 }
408 412
409 } // namespace ash 413 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash.gyp ('k') | ash/display/display_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698