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

Unified Diff: ash/desktop_background/desktop_background_view.cc

Issue 9703031: Retry landing "Enable users change desktop background image from settings page in Chromeos Aura bui… (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge to trunk Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/desktop_background/desktop_background_view.h ('k') | ash/shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/desktop_background/desktop_background_view.cc
diff --git a/ash/desktop_background/desktop_background_view.cc b/ash/desktop_background/desktop_background_view.cc
index dbf256f0499df461eccbaff9cee46a3b78ca9305..96c4a6ee6808cde8c8b2ff5a39d3ff2882ea199e 100644
--- a/ash/desktop_background/desktop_background_view.cc
+++ b/ash/desktop_background/desktop_background_view.cc
@@ -28,15 +28,20 @@ static int RoundPositive(double x) {
////////////////////////////////////////////////////////////////////////////////
// DesktopBackgroundView, public:
-DesktopBackgroundView::DesktopBackgroundView() {
- wallpaper_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed(
- IDR_AURA_WALLPAPER_1).ToSkBitmap();
+DesktopBackgroundView::DesktopBackgroundView(const SkBitmap& wallpaper) {
+ wallpaper_ = wallpaper;
wallpaper_.buildMipMap(false);
}
DesktopBackgroundView::~DesktopBackgroundView() {
}
+void DesktopBackgroundView::SetWallpaper(const SkBitmap& wallpaper) {
+ wallpaper_ = wallpaper;
+ wallpaper_.buildMipMap(false);
+ SchedulePaint();
+}
+
////////////////////////////////////////////////////////////////////////////////
// DesktopBackgroundView, views::View overrides:
@@ -88,11 +93,11 @@ void DesktopBackgroundView::OnMouseReleased(const views::MouseEvent& event) {
Shell::GetInstance()->ShowBackgroundMenu(GetWidget(), event.location());
}
-views::Widget* CreateDesktopBackground() {
+views::Widget* CreateDesktopBackground(const SkBitmap& wallpaper) {
views::Widget* desktop_widget = new views::Widget;
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
- DesktopBackgroundView* view = new DesktopBackgroundView;
+ DesktopBackgroundView* view = new DesktopBackgroundView(wallpaper);
params.delegate = view;
params.parent =
Shell::GetInstance()->GetContainer(
« no previous file with comments | « ash/desktop_background/desktop_background_view.h ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698