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

Unified Diff: views/widget/window_manager.h

Issue 8562003: Revert "views: Move widget/ directory to ui/views." properly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « views/widget/widget_unittest.cc ('k') | views/widget/window_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/window_manager.h
diff --git a/views/widget/window_manager.h b/views/widget/window_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..f634bf013187d048dc8b0a67945b80e2a6d23150
--- /dev/null
+++ b/views/widget/window_manager.h
@@ -0,0 +1,79 @@
+// 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 VIEWS_WIDGET_WINDOW_MANAGER_H_
+#define VIEWS_WIDGET_WINDOW_MANAGER_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "ui/base/events.h"
+#include "views/views_export.h"
+
+namespace gfx {
+class Point;
+}
+
+namespace views {
+class KeyEvent;
+class MouseEvent;
+class TouchEvent;
+class Widget;
+
+// A interface to WindowManager.
+class VIEWS_EXPORT WindowManager {
+ public:
+ WindowManager();
+ virtual ~WindowManager();
+
+ // Starts moving window given by |widget|. |point| represents the
+ // initial location of the mouse pointer.
+ virtual void StartMoveDrag(Widget* widget, const gfx::Point& point) = 0;
+
+ // Starts resizing window give by |widget|. |point| represents the
+ // initial location of the mouse pointer and |hittest_code| represents
+ // the edge of the window a user selected to resize the window. See
+ // ui/base/hit_test.h for the hittest_code definition.
+ virtual void StartResizeDrag(
+ Widget* widget, const gfx::Point& point, int hittest_code) = 0;
+
+ // Sets mouse capture on |widget|. Returns false if other widget
+ // already has mouse capture.
+ virtual bool SetMouseCapture(Widget* widget) = 0;
+
+ // Releases the mouse capture on |widget|. Returns false if |widget|
+ // haven't capture the mouse.
+ virtual bool ReleaseMouseCapture(Widget* widget) = 0;
+
+ // Checks if the |widget| has mouse capture.
+ virtual bool HasMouseCapture(const Widget* widget) const = 0;
+
+ // WindowManager handles mouse event first. It may reisze/move window,
+ // or send the event to widget that has mouse capture.
+ virtual bool HandleKeyEvent(Widget* widget, const KeyEvent& event) = 0;
+
+ // WindowManager handles mouse event first. It may resize/move window,
+ // or send the event to widget that has mouse capture.
+ virtual bool HandleMouseEvent(Widget* widget, const MouseEvent& event) = 0;
+
+ // WindowManager handles touch event first. It is currently used only to
+ // activate windows. But it can also be used to move/resize windows.
+ virtual ui::TouchStatus HandleTouchEvent(Widget* widget,
+ const TouchEvent& event) = 0;
+
+ // Register widget to the window manager.
+ virtual void Register(Widget* widget) = 0;
+
+ // Installs window manager.
+ static void Install(WindowManager* wm);
+
+ // Returns installed WindowManager.
+ static WindowManager* Get();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(WindowManager);
+};
+
+} // namespace views
+
+#endif // VIEWS_WIDGET_WINDOW_MANAGER_H_
« no previous file with comments | « views/widget/widget_unittest.cc ('k') | views/widget/window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698