Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2776)

Unified Diff: ash/desktop_background/desktop_background_component.h

Issue 10810039: 2nd display should show the same background as login/lock screen: (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge with ToT Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/desktop_background/desktop_background_component.h
diff --git a/ash/desktop_background/desktop_background_component.h b/ash/desktop_background/desktop_background_component.h
new file mode 100644
index 0000000000000000000000000000000000000000..a5b520a5b276475c88bdd20ad93a596e21c2a7af
--- /dev/null
+++ b/ash/desktop_background/desktop_background_component.h
@@ -0,0 +1,51 @@
+// 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_
+#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.
sky 2012/07/25 20:47:36 Change the implementation so we use a Widget for b
+class DesktopBackgroundComponent {
sky 2012/07/25 20:47:36 Name this DesktopBackgroundWidgetController
Denis Kuznetsov (DE-MUC) 2012/07/26 13:51:13 Done.
+ public:
+ 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.
+ 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.
+
+ ~DesktopBackgroundComponent();
+
+ // Set bounds for component.
+ 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 DesktopBackgroundComponent to
+// root windows.
+extern const aura::WindowProperty<DesktopBackgroundComponent*>* const
+ kWindowDesktopComponent;
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_COMPONENT_H_

Powered by Google App Engine
This is Rietveld 408576698