| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXAMPLES_WM_FLOW_WM_FRAME_CONTROLLER_H_ | 5 #ifndef EXAMPLES_WM_FLOW_WM_FRAME_CONTROLLER_H_ |
| 6 #define EXAMPLES_WM_FLOW_WM_FRAME_CONTROLLER_H_ | 6 #define EXAMPLES_WM_FLOW_WM_FRAME_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "mojo/services/public/cpp/view_manager/view_observer.h" | 9 #include "mojo/services/public/cpp/view_manager/view_observer.h" |
| 10 #include "services/window_manager/focus_controller.h" | 10 #include "services/window_manager/focus_controller.h" |
| 11 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
| 12 | 12 |
| 13 namespace mojo { | 13 namespace mojo { |
| 14 class NativeWidgetViewManager; | 14 class NativeWidgetViewManager; |
| 15 class Shell; | 15 class Shell; |
| 16 class View; | 16 class View; |
| 17 class WindowManagerApp; | |
| 18 } | 17 } |
| 19 | 18 |
| 20 namespace views { | 19 namespace views { |
| 21 class View; | 20 class View; |
| 22 class Widget; | 21 class Widget; |
| 23 } | 22 } |
| 24 | 23 |
| 24 namespace window_manager { |
| 25 class WindowManagerApp; |
| 26 } |
| 27 |
| 25 // FrameController encapsulates the window manager's frame additions to a window | 28 // FrameController encapsulates the window manager's frame additions to a window |
| 26 // created by an application. It renders the content of the frame and responds | 29 // created by an application. It renders the content of the frame and responds |
| 27 // to any events targeted at it. | 30 // to any events targeted at it. |
| 28 class FrameController : mojo::ViewObserver { | 31 class FrameController : mojo::ViewObserver { |
| 29 public: | 32 public: |
| 30 FrameController(mojo::Shell* shell, | 33 FrameController(mojo::Shell* shell, |
| 31 mojo::View* view, | 34 mojo::View* view, |
| 32 mojo::View** app_view, | 35 mojo::View** app_view, |
| 33 mojo::WindowManagerApp* window_manager_app); | 36 window_manager::WindowManagerApp* window_manager_app); |
| 34 virtual ~FrameController(); | 37 virtual ~FrameController(); |
| 35 | 38 |
| 36 void CloseWindow(); | 39 void CloseWindow(); |
| 37 void ToggleMaximize(); | 40 void ToggleMaximize(); |
| 38 | 41 |
| 39 void ActivateWindow(); | 42 void ActivateWindow(); |
| 40 | 43 |
| 41 private: | 44 private: |
| 42 class LayoutManager; | 45 class LayoutManager; |
| 43 friend class LayoutManager; | 46 friend class LayoutManager; |
| 44 class FrameEventHandler; | 47 class FrameEventHandler; |
| 45 | 48 |
| 46 virtual void OnViewDestroyed(mojo::View* view) override; | 49 virtual void OnViewDestroyed(mojo::View* view) override; |
| 47 | 50 |
| 48 mojo::View* view_; | 51 mojo::View* view_; |
| 49 mojo::View* app_view_; | 52 mojo::View* app_view_; |
| 50 views::View* frame_view_; | 53 views::View* frame_view_; |
| 51 LayoutManager* frame_view_layout_manager_; | 54 LayoutManager* frame_view_layout_manager_; |
| 52 views::Widget* widget_; | 55 views::Widget* widget_; |
| 53 bool maximized_; | 56 bool maximized_; |
| 54 gfx::Rect restored_bounds_; | 57 gfx::Rect restored_bounds_; |
| 55 mojo::WindowManagerApp* window_manager_app_; | 58 window_manager::WindowManagerApp* window_manager_app_; |
| 56 scoped_ptr<FrameEventHandler> frame_event_handler_; | 59 scoped_ptr<FrameEventHandler> frame_event_handler_; |
| 57 | 60 |
| 58 DISALLOW_COPY_AND_ASSIGN(FrameController); | 61 DISALLOW_COPY_AND_ASSIGN(FrameController); |
| 59 }; | 62 }; |
| 60 | 63 |
| 61 #endif // EXAMPLES_WM_FLOW_WM_FRAME_CONTROLLER_H_ | 64 #endif // EXAMPLES_WM_FLOW_WM_FRAME_CONTROLLER_H_ |
| OLD | NEW |