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_WIDGET_CONTROLLER_H_ | |
6 #define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_WIDGET_CONTROLLER_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. | |
18 class DesktopBackgroundWidgetController { | |
19 public: | |
20 // Create | |
21 explicit DesktopBackgroundWidgetController(views::Widget* widget); | |
22 explicit DesktopBackgroundWidgetController(ui::Layer* layer); | |
23 | |
24 ~DesktopBackgroundWidgetController(); | |
25 | |
26 // Set bounds of component that draws background. | |
27 void SetBounds(gfx::Rect bounds); | |
28 | |
29 // Move component from |src_container| in |root_window| to |dest_container|. | |
30 // It is required for lock screen, when we need to move background so that | |
31 // it hides user's windows. | |
32 void Reparent(aura::RootWindow* root_window, | |
33 int src_container, | |
34 int dest_container); | |
35 | |
36 views::Widget* widget() { return widget_; } | |
37 ui::Layer* layer() { return layer_.get(); } | |
38 | |
39 private: | |
40 views::Widget* widget_; | |
41 scoped_ptr<ui::Layer> layer_; | |
Ben Goodger (Google)
2012/07/30 21:08:33
outdent both these lines by 1.
DISALLOW_COPY_AND_
| |
42 }; | |
43 | |
44 // Window property key, that binds instance of DesktopBackgroundWidgetController | |
45 // to root windows. | |
46 extern const aura::WindowProperty<DesktopBackgroundWidgetController*>* const | |
47 kWindowDesktopComponent; | |
48 | |
49 } // namespace internal | |
50 } // namespace ash | |
51 | |
52 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_WIDGET_CONTROLLER_H_ | |
OLD | NEW |