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

Side by Side Diff: views/desktop/desktop_window_manager.h

Issue 8568022: views: Move desktop and touchui directories to ui/views/. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/desktop/desktop_views_delegate.cc ('k') | views/desktop/desktop_window_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 VIEWS_DESKTOP_DESKTOP_WINDOW_MANAGER_H_
6 #define VIEWS_DESKTOP_DESKTOP_WINDOW_MANAGER_H_
7 #pragma once
8
9 #include <vector>
10
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "views/widget/widget.h"
15 #include "views/widget/window_manager.h"
16
17
18 namespace gfx {
19 class Point;
20 }
21
22 namespace views {
23 namespace desktop {
24
25 class WindowController;
26
27 // A tentative window manager for views destktop until we have *right*
28 // implementation based on aura/layer API. This is minimum
29 // implmenetation and complicated actio like moving transformed window
30 // doesn't work.
31 class DesktopWindowManager : public views::WindowManager,
32 public Widget::Observer {
33 public:
34 DesktopWindowManager(Widget* desktop);
35 virtual ~DesktopWindowManager();
36
37 void UpdateWindowsAfterScreenSizeChanged(const gfx::Rect& new_size);
38
39 // views::WindowManager implementations:
40 virtual void StartMoveDrag(views::Widget* widget,
41 const gfx::Point& point) OVERRIDE;
42 virtual void StartResizeDrag(views::Widget* widget,
43 const gfx::Point& point,
44 int hittest_code);
45 virtual bool SetMouseCapture(views::Widget* widget) OVERRIDE;
46 virtual bool ReleaseMouseCapture(views::Widget* widget) OVERRIDE;
47 virtual bool HasMouseCapture(const views::Widget* widget) const OVERRIDE;
48 virtual bool HandleKeyEvent(views::Widget* widget,
49 const views::KeyEvent& event) OVERRIDE;
50 virtual bool HandleMouseEvent(views::Widget* widget,
51 const views::MouseEvent& event) OVERRIDE;
52 virtual ui::TouchStatus HandleTouchEvent(views::Widget* widget,
53 const views::TouchEvent& event) OVERRIDE;
54
55 virtual void Register(Widget* widget) OVERRIDE;
56
57 private:
58 // Overridden from Widget::Observer.
59 virtual void OnWidgetClosing(Widget* widget) OVERRIDE;
60 virtual void OnWidgetVisibilityChanged(Widget* widget, bool visible) OVERRIDE;
61 virtual void OnWidgetActivationChanged(Widget* widget, bool active) OVERRIDE;
62
63 void SetMouseCapture();
64 void ReleaseMouseCapture();
65 bool HasMouseCapture() const;
66
67 void Activate(Widget* widget);
68
69 // Returns true if a deactivated widget at the location was activated. Returns
70 // false otherwise.
71 bool ActivateWidgetAtLocation(Widget* widget, const gfx::Point& point);
72
73 views::Widget* desktop_;
74 views::Widget* mouse_capture_;
75 views::Widget* active_widget_;
76
77 // An unordered list of all the top-level Widgets.
78 std::vector<views::Widget*> toplevels_;
79
80 scoped_ptr<WindowController> window_controller_;
81
82 DISALLOW_COPY_AND_ASSIGN(DesktopWindowManager);
83 };
84
85 // An behavioral interface for objects implements window resize/movement.
86 class WindowController {
87 public:
88 WindowController();
89 virtual ~WindowController();
90 virtual bool OnMouseEvent(const views::MouseEvent& event) = 0;
91
92 private:
93 DISALLOW_COPY_AND_ASSIGN(WindowController);
94 };
95
96 } // namespace desktop
97 } // namespace views
98
99 #endif // VIEWS_DESKTOP_DESKTOP_WINDOW_MANAGER_H_
OLDNEW
« no previous file with comments | « views/desktop/desktop_views_delegate.cc ('k') | views/desktop/desktop_window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698