Index: ash/desktop_background/desktop_background_widget_controller.h |
diff --git a/ash/desktop_background/desktop_background_widget_controller.h b/ash/desktop_background/desktop_background_widget_controller.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d31464e6bfd8ec57bd218f5b96852b1a3833ab98 |
--- /dev/null |
+++ b/ash/desktop_background/desktop_background_widget_controller.h |
@@ -0,0 +1,52 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_COMPONENT_H_ |
Nikita (slow)
2012/07/28 01:32:17
Please rename according to the new file name.
Denis Kuznetsov (DE-MUC)
2012/07/30 15:40:02
Done.
|
+#define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_COMPONENT_H_ |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "ui/aura/window_property.h" |
+#include "ui/compositor/layer.h" |
+#include "ui/views/widget/widget.h" |
+ |
+namespace ash { |
+namespace internal { |
+ |
+// This class hides difference between two possible background implementations: |
+// effective Layer-based for solid color, and Widget-based for images. |
+class DesktopBackgroundWidgetController { |
+ public: |
+ // Create |
+ explicit DesktopBackgroundWidgetController(views::Widget* widget); |
+ explicit DesktopBackgroundWidgetController(ui::Layer* layer); |
+ |
+ ~DesktopBackgroundWidgetController(); |
+ |
+ // Set bounds for component. |
Nikita (slow)
2012/07/28 01:32:17
nit: Usage of word "component" is not clear in thi
Denis Kuznetsov (DE-MUC)
2012/07/30 15:40:02
Done.
|
+ void SetBounds(gfx::Rect bounds); |
+ |
+ // Move component from |src_container| in |root_window| to |dest_container|. |
+ // It is required for lock screen, when we need to move background so that |
+ // it hides user's windows. |
+ void Reparent(aura::RootWindow* root_window, |
+ int src_container, |
+ int dest_container); |
+ |
+ views::Widget* widget() { return widget_; } |
+ ui::Layer* layer() { return layer_.get(); } |
+ |
+ private: |
+ views::Widget* widget_; |
+ scoped_ptr<ui::Layer> layer_; |
+}; |
+ |
+// Window property key, that binds instance of DesktopBackgroundWidgetController |
+// to root windows. |
+extern const aura::WindowProperty<DesktopBackgroundWidgetController*>* const |
+ kWindowDesktopComponent; |
+ |
+} // namespace internal |
+} // namespace ash |
+ |
+#endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_COMPONENT_H_ |