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() | 19 BackgroundView() |
20 : time_view_(SystemUI::Get()->CreateTimeView()), | 20 : time_view_(NULL), |
21 status_icon_view_(SystemUI::Get()->CreateStatusIconView()) { | 21 status_icon_view_(NULL) { |
| 22 time_view_ = SystemUI::Get()->CreateTimeView(SystemUI::COLOR_SCHEME_LIGHT); |
| 23 status_icon_view_ = |
| 24 SystemUI::Get()->CreateStatusIconView(SystemUI::COLOR_SCHEME_LIGHT); |
22 AddChildView(time_view_); | 25 AddChildView(time_view_); |
23 AddChildView(status_icon_view_); | 26 AddChildView(status_icon_view_); |
24 } | 27 } |
25 virtual ~BackgroundView() {} | 28 virtual ~BackgroundView() {} |
26 | 29 |
27 void SetImage(const gfx::ImageSkia& image) { | 30 void SetImage(const gfx::ImageSkia& image) { |
28 image_ = image; | 31 image_ = image; |
29 SchedulePaint(); | 32 SchedulePaint(); |
30 } | 33 } |
31 | 34 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // background_widget is owned by the container and will be deleted | 86 // background_widget is owned by the container and will be deleted |
84 // when the container is deleted. | 87 // when the container is deleted. |
85 } | 88 } |
86 | 89 |
87 void BackgroundController::SetImage(const gfx::ImageSkia& image) { | 90 void BackgroundController::SetImage(const gfx::ImageSkia& image) { |
88 // TODO(oshima): implement cross fede animation. | 91 // TODO(oshima): implement cross fede animation. |
89 background_view_->SetImage(image); | 92 background_view_->SetImage(image); |
90 } | 93 } |
91 | 94 |
92 } // namespace athena | 95 } // namespace athena |
OLD | NEW |