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

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

Issue 16998003: Update CrOS to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | « no previous file | base/prefs/testing_pref_service.h » ('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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 return WALLPAPER_LAYOUT_CENTER_CROPPED; 167 return WALLPAPER_LAYOUT_CENTER_CROPPED;
168 } 168 }
169 169
170 gfx::ImageSkia DesktopBackgroundController::GetCurrentWallpaperImage() { 170 gfx::ImageSkia DesktopBackgroundController::GetCurrentWallpaperImage() {
171 if (desktop_background_mode_ != BACKGROUND_IMAGE) 171 if (desktop_background_mode_ != BACKGROUND_IMAGE)
172 return gfx::ImageSkia(); 172 return gfx::ImageSkia();
173 return GetWallpaper(); 173 return GetWallpaper();
174 } 174 }
175 175
176 int DesktopBackgroundController::GetWallpaperIDR() const { 176 int DesktopBackgroundController::GetWallpaperIDR() const {
177 if (wallpaper_loader_) 177 if (wallpaper_loader_.get())
178 return wallpaper_loader_->idr(); 178 return wallpaper_loader_->idr();
179 else if (current_wallpaper_) 179 else if (current_wallpaper_)
180 return current_wallpaper_->wallpaper_info().idr; 180 return current_wallpaper_->wallpaper_info().idr;
181 else 181 else
182 return -1; 182 return -1;
183 } 183 }
184 184
185 void DesktopBackgroundController::OnRootWindowAdded( 185 void DesktopBackgroundController::OnRootWindowAdded(
186 aura::RootWindow* root_window) { 186 aura::RootWindow* root_window) {
187 // The background hasn't been set yet. 187 // The background hasn't been set yet.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 current_wallpaper_.reset(new WallpaperResizer(info, GetRootWindowsSize(), 235 current_wallpaper_.reset(new WallpaperResizer(info, GetRootWindowsSize(),
236 wallpaper)); 236 wallpaper));
237 current_wallpaper_->StartResize(); 237 current_wallpaper_->StartResize();
238 FOR_EACH_OBSERVER(DesktopBackgroundControllerObserver, observers_, 238 FOR_EACH_OBSERVER(DesktopBackgroundControllerObserver, observers_,
239 OnWallpaperDataChanged()); 239 OnWallpaperDataChanged());
240 SetDesktopBackgroundImageMode(); 240 SetDesktopBackgroundImageMode();
241 } 241 }
242 242
243 void DesktopBackgroundController::CancelPendingWallpaperOperation() { 243 void DesktopBackgroundController::CancelPendingWallpaperOperation() {
244 // Set canceled flag of previous request to skip unneeded loading. 244 // Set canceled flag of previous request to skip unneeded loading.
245 if (wallpaper_loader_) 245 if (wallpaper_loader_.get())
246 wallpaper_loader_->Cancel(); 246 wallpaper_loader_->Cancel();
247 247
248 // Cancel reply callback for previous request. 248 // Cancel reply callback for previous request.
249 weak_ptr_factory_.InvalidateWeakPtrs(); 249 weak_ptr_factory_.InvalidateWeakPtrs();
250 } 250 }
251 251
252 void DesktopBackgroundController::SetDesktopBackgroundSolidColorMode( 252 void DesktopBackgroundController::SetDesktopBackgroundSolidColorMode(
253 SkColor color) { 253 SkColor color) {
254 background_color_ = color; 254 background_color_ = color;
255 desktop_background_mode_ = BACKGROUND_SOLID_COLOR; 255 desktop_background_mode_ = BACKGROUND_SOLID_COLOR;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 } 423 }
424 return moved; 424 return moved;
425 } 425 }
426 426
427 int DesktopBackgroundController::GetBackgroundContainerId(bool locked) { 427 int DesktopBackgroundController::GetBackgroundContainerId(bool locked) {
428 return locked ? internal::kShellWindowId_LockScreenBackgroundContainer : 428 return locked ? internal::kShellWindowId_LockScreenBackgroundContainer :
429 internal::kShellWindowId_DesktopBackgroundContainer; 429 internal::kShellWindowId_DesktopBackgroundContainer;
430 } 430 }
431 431
432 } // namespace ash 432 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | base/prefs/testing_pref_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698