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

Unified Diff: aura/window.h

Issue 7534002: Shell of implementation for embedded windows. At this point this is (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback Created 9 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
« no previous file with comments | « aura/desktop_host_win.cc ('k') | aura/window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: aura/window.h
diff --git a/aura/window.h b/aura/window.h
new file mode 100644
index 0000000000000000000000000000000000000000..14c3ea4c2bb0d5739ae96d7d201ad1b911c16617
--- /dev/null
+++ b/aura/window.h
@@ -0,0 +1,92 @@
+// Copyright (c) 2011 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 AURA_WINDOW_H_
+#define AURA_WINDOW_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "ui/gfx/native_widget_types.h"
+#include "ui/gfx/rect.h"
+
+class SkCanvas;
+
+namespace ui {
+class Layer;
+}
+
+namespace aura {
+
+class Desktop;
+class WindowDelegate;
+
+// Aura window implementation. Interesting events are sent to the
+// WindowDelegate.
+class Window {
+ public:
+ enum Visibility {
+ // Don't display the window onscreen and don't let it receive mouse
+ // events. This is the default.
+ VISIBILITY_HIDDEN = 1,
+
+ // Display the window and let it receive mouse events.
+ VISIBILITY_SHOWN = 2,
+
+ // Display the window but prevent it from receiving mouse events.
+ VISIBILITY_SHOWN_NO_INPUT = 3,
+ };
+
+ explicit Window(Desktop* desktop);
+ ~Window();
+
+ void set_delegate(WindowDelegate* d) { delegate_ = d; }
+
+ // Changes the visbility of the window.
+ void SetVisibility(Visibility visibility);
+ Visibility visibility() const { return visibility_; }
+
+ // Changes the bounds of the window.
+ void SetBounds(const gfx::Rect& bounds, int anim_ms);
+ const gfx::Rect& bounds() const { return bounds_; }
+
+ // Marks the window as needing to be painted.
+ void SchedulePaint(const gfx::Rect& bounds);
+
+ // Sets the contents of the window.
+ void SetCanvas(const SkCanvas& canvas, const gfx::Point& origin);
+
+ // If the window is visible its layer is drawn.
+ void Draw();
+
+ // If SchedulePaint has been invoked on the Window the delegate is notified.
+ void UpdateLayerCanvas();
+
+ private:
+ // The desktop we're in.
+ Desktop* desktop_;
+
+ WindowDelegate* delegate_;
+
+ Visibility visibility_;
+
+ scoped_ptr<ui::Layer> layer_;
+
+ // Union of regions passed to SchedulePaint. Cleaned when UpdateLayerCanvas is
+ // invoked.
+ gfx::Rect dirty_rect_;
+
+ // If true UpdateLayerCanvas paints all. This is set when the window is first
+ // created to trigger painting the complete bounds.
+ bool needs_paint_all_;
+
+ // Bounds of the window in the desktop's coordinate system.
+ gfx::Rect bounds_;
+
+ DISALLOW_COPY_AND_ASSIGN(Window);
+};
+
+} // namespace aura
+
+#endif // AURA_WINDOW_H_
« no previous file with comments | « aura/desktop_host_win.cc ('k') | aura/window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698