| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/system/background_controller.h" | 5 #include "athena/system/background_controller.h" |
| 6 | 6 |
| 7 #include "athena/system/public/system_ui.h" | 7 #include "athena/system/public/system_ui.h" |
| 8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
| 9 #include "ui/compositor/layer.h" | 9 #include "ui/compositor/layer.h" |
| 10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
| 11 #include "ui/gfx/image/image_skia.h" | 11 #include "ui/gfx/image/image_skia.h" |
| 12 #include "ui/views/view.h" | 12 #include "ui/views/view.h" |
| 13 #include "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget.h" |
| 14 | 14 |
| 15 namespace athena { | 15 namespace athena { |
| 16 | 16 |
| 17 class BackgroundView : public views::View { | 17 class BackgroundView : public views::View { |
| 18 public: | 18 public: |
| 19 BackgroundView() : system_info_view_(NULL) { | 19 BackgroundView() : system_info_view_(nullptr) { |
| 20 system_info_view_ = | 20 system_info_view_ = |
| 21 SystemUI::Get()->CreateSystemInfoView(SystemUI::COLOR_SCHEME_LIGHT); | 21 SystemUI::Get()->CreateSystemInfoView(SystemUI::COLOR_SCHEME_LIGHT); |
| 22 AddChildView(system_info_view_); | 22 AddChildView(system_info_view_); |
| 23 } | 23 } |
| 24 virtual ~BackgroundView() {} | 24 virtual ~BackgroundView() {} |
| 25 | 25 |
| 26 void SetImage(const gfx::ImageSkia& image) { | 26 void SetImage(const gfx::ImageSkia& image) { |
| 27 image_ = image; | 27 image_ = image; |
| 28 SchedulePaint(); | 28 SchedulePaint(); |
| 29 } | 29 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // background_widget is owned by the container and will be deleted | 71 // background_widget is owned by the container and will be deleted |
| 72 // when the container is deleted. | 72 // when the container is deleted. |
| 73 } | 73 } |
| 74 | 74 |
| 75 void BackgroundController::SetImage(const gfx::ImageSkia& image) { | 75 void BackgroundController::SetImage(const gfx::ImageSkia& image) { |
| 76 // TODO(oshima): implement cross fede animation. | 76 // TODO(oshima): implement cross fede animation. |
| 77 background_view_->SetImage(image); | 77 background_view_->SetImage(image); |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace athena | 80 } // namespace athena |
| OLD | NEW |