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

Side by Side Diff: ash/wm/system_background_controller.cc

Issue 2290473004: Rename ash desktop_background to wallpaper. (Closed)
Patch Set: Address comments. Created 4 years, 3 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
« no previous file with comments | « ash/wm/system_background_controller.h ('k') | ash/wm/system_wallpaper_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ash/wm/system_background_controller.h"
6
7 #include "ui/aura/window.h"
8 #include "ui/compositor/layer.h"
9 #include "ui/compositor/layer_type.h"
10
11 namespace ash {
12
13 SystemBackgroundController::SystemBackgroundController(
14 aura::Window* root_window,
15 SkColor color)
16 : root_window_(root_window), layer_(new ui::Layer(ui::LAYER_SOLID_COLOR)) {
17 root_window_->AddObserver(this);
18 layer_->SetColor(color);
19
20 ui::Layer* root_layer = root_window_->layer();
21 layer_->SetBounds(gfx::Rect(root_layer->bounds().size()));
22 root_layer->Add(layer_.get());
23 root_layer->StackAtBottom(layer_.get());
24 }
25
26 SystemBackgroundController::~SystemBackgroundController() {
27 root_window_->RemoveObserver(this);
28 }
29
30 void SystemBackgroundController::SetColor(SkColor color) {
31 layer_->SetColor(color);
32 }
33
34 void SystemBackgroundController::OnWindowBoundsChanged(
35 aura::Window* root,
36 const gfx::Rect& old_bounds,
37 const gfx::Rect& new_bounds) {
38 DCHECK_EQ(root_window_, root);
39 layer_->SetBounds(gfx::Rect(root_window_->layer()->bounds().size()));
40 }
41
42 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/system_background_controller.h ('k') | ash/wm/system_wallpaper_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698