OLD | NEW |
---|---|
(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 #ifndef ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_COMPONENT_H_ | |
6 #define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_COMPONENT_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "ui/aura/window_property.h" | |
10 #include "ui/compositor/layer.h" | |
11 #include "ui/views/widget/widget.h" | |
12 | |
13 namespace ash { | |
14 namespace internal { | |
15 | |
16 // This class hides difference between two possible background implementations: | |
17 // effective Layer-based for solid color, and Widget-based for images. | |
sky
2012/07/25 20:47:36
Change the implementation so we use a Widget for b
| |
18 class DesktopBackgroundComponent { | |
sky
2012/07/25 20:47:36
Name this DesktopBackgroundWidgetController
Denis Kuznetsov (DE-MUC)
2012/07/26 13:51:13
Done.
| |
19 public: | |
20 DesktopBackgroundComponent(views::Widget* widget); | |
Nikita (slow)
2012/07/25 20:45:24
explicit
sky
2012/07/25 20:47:36
explicit
Denis Kuznetsov (DE-MUC)
2012/07/26 13:51:13
Done.
| |
21 DesktopBackgroundComponent(ui::Layer* layer); | |
Nikita (slow)
2012/07/25 20:45:24
explicit
Nikita (slow)
2012/07/25 20:45:24
Please add comment that would clarify that layer o
Denis Kuznetsov (DE-MUC)
2012/07/26 13:51:13
Done.
| |
22 | |
23 ~DesktopBackgroundComponent(); | |
24 | |
25 // Set bounds for component. | |
26 void SetBounds(gfx::Rect bounds); | |
27 | |
28 // Move component from |src_container| in |root_window| to |dest_container|. | |
29 // It is required for lock screen, when we need to move background so that | |
30 // it hides user's windows. | |
31 void Reparent(aura::RootWindow* root_window, | |
32 int src_container, | |
33 int dest_container); | |
34 | |
35 views::Widget* widget() { return widget_; } | |
36 ui::Layer* layer() { return layer_.get(); } | |
37 | |
38 private: | |
39 views::Widget* widget_; | |
40 scoped_ptr<ui::Layer> layer_; | |
41 }; | |
42 | |
43 // Window property key, that binds instance of DesktopBackgroundComponent to | |
44 // root windows. | |
45 extern const aura::WindowProperty<DesktopBackgroundComponent*>* const | |
46 kWindowDesktopComponent; | |
47 | |
48 } // namespace internal | |
49 } // namespace ash | |
50 | |
51 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_COMPONENT_H_ | |
OLD | NEW |