| OLD | NEW |
| 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/wm/system_background_controller.h" | 5 #include "ash/wm/system_background_controller.h" |
| 6 | 6 |
| 7 #include "ui/aura/root_window.h" | 7 #include "ui/aura/root_window.h" |
| 8 #include "ui/compositor/layer.h" | 8 #include "ui/compositor/layer.h" |
| 9 #include "ui/compositor/layer_type.h" | 9 #include "ui/compositor/layer_type.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 namespace { | |
| 15 | |
| 16 #if defined(OS_CHROMEOS) | |
| 17 // Background color used for the Chrome OS boot splash screen. | |
| 18 const SkColor kChromeOsBootColor = SkColorSetARGB(0xff, 0xfe, 0xfe, 0xfe); | |
| 19 #endif | |
| 20 | |
| 21 } // namespace | |
| 22 | |
| 23 SystemBackgroundController::SystemBackgroundController( | 14 SystemBackgroundController::SystemBackgroundController( |
| 24 aura::RootWindow* root_window, | 15 aura::RootWindow* root_window, |
| 25 SkColor color) | 16 SkColor color) |
| 26 : root_window_(root_window), | 17 : root_window_(root_window), |
| 27 layer_(new ui::Layer(ui::LAYER_SOLID_COLOR)) { | 18 layer_(new ui::Layer(ui::LAYER_SOLID_COLOR)) { |
| 28 root_window_->AddObserver(this); | 19 root_window_->AddObserver(this); |
| 29 layer_->SetColor(color); | 20 layer_->SetColor(color); |
| 30 | 21 |
| 31 ui::Layer* root_layer = root_window_->layer(); | 22 ui::Layer* root_layer = root_window_->layer(); |
| 32 layer_->SetBounds(gfx::Rect(root_layer->bounds().size())); | 23 layer_->SetBounds(gfx::Rect(root_layer->bounds().size())); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 45 void SystemBackgroundController::OnWindowBoundsChanged( | 36 void SystemBackgroundController::OnWindowBoundsChanged( |
| 46 aura::Window* root, | 37 aura::Window* root, |
| 47 const gfx::Rect& old_bounds, | 38 const gfx::Rect& old_bounds, |
| 48 const gfx::Rect& new_bounds) { | 39 const gfx::Rect& new_bounds) { |
| 49 DCHECK_EQ(root_window_, root); | 40 DCHECK_EQ(root_window_, root); |
| 50 layer_->SetBounds(gfx::Rect(root_window_->layer()->bounds().size())); | 41 layer_->SetBounds(gfx::Rect(root_window_->layer()->bounds().size())); |
| 51 } | 42 } |
| 52 | 43 |
| 53 } // namespace internal | 44 } // namespace internal |
| 54 } // namespace ash | 45 } // namespace ash |
| OLD | NEW |