| 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 MOJO_EXAMPLES_WM_FLOW_WM_FRAME_CONTROLLER_H_ | 5 #ifndef MOJO_EXAMPLES_WM_FLOW_WM_FRAME_CONTROLLER_H_ |
| 6 #define MOJO_EXAMPLES_WM_FLOW_WM_FRAME_CONTROLLER_H_ | 6 #define MOJO_EXAMPLES_WM_FLOW_WM_FRAME_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 8 #include "mojo/services/public/cpp/view_manager/view_observer.h" | 9 #include "mojo/services/public/cpp/view_manager/view_observer.h" |
| 9 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
| 10 | 11 |
| 12 namespace aura { |
| 13 namespace client { |
| 14 class ActivationClient; |
| 15 } |
| 16 } |
| 17 |
| 11 namespace mojo { | 18 namespace mojo { |
| 12 class NativeWidgetViewManager; | 19 class NativeWidgetViewManager; |
| 13 class View; | 20 class View; |
| 21 class WindowManagerApp; |
| 14 } | 22 } |
| 15 | 23 |
| 16 namespace views { | 24 namespace views { |
| 17 class View; | 25 class View; |
| 18 class Widget; | 26 class Widget; |
| 19 } | 27 } |
| 20 | 28 |
| 21 // FrameController encapsulates the window manager's frame additions to a window | 29 // FrameController encapsulates the window manager's frame additions to a window |
| 22 // created by an application. It renders the content of the frame and responds | 30 // created by an application. It renders the content of the frame and responds |
| 23 // to any events targeted at it. | 31 // to any events targeted at it. |
| 24 class FrameController : mojo::ViewObserver { | 32 class FrameController : mojo::ViewObserver { |
| 25 public: | 33 public: |
| 26 FrameController(mojo::View* view, mojo::View** app_view); | 34 FrameController(mojo::View* view, |
| 35 mojo::View** app_view, |
| 36 aura::client::ActivationClient* activation_client, |
| 37 mojo::WindowManagerApp* window_manager_app); |
| 27 virtual ~FrameController(); | 38 virtual ~FrameController(); |
| 28 | 39 |
| 29 void CloseWindow(); | 40 void CloseWindow(); |
| 30 void ToggleMaximize(); | 41 void ToggleMaximize(); |
| 31 | 42 |
| 43 void ActivateWindow(); |
| 44 |
| 32 private: | 45 private: |
| 33 class LayoutManager; | 46 class LayoutManager; |
| 34 friend class LayoutManager; | 47 friend class LayoutManager; |
| 48 class FrameEventHandler; |
| 35 | 49 |
| 36 virtual void OnViewDestroyed(mojo::View* view) MOJO_OVERRIDE; | 50 virtual void OnViewDestroyed(mojo::View* view) MOJO_OVERRIDE; |
| 37 | 51 |
| 38 mojo::View* view_; | 52 mojo::View* view_; |
| 39 mojo::View* app_view_; | 53 mojo::View* app_view_; |
| 40 views::View* frame_view_; | 54 views::View* frame_view_; |
| 41 LayoutManager* frame_view_layout_manager_; | 55 LayoutManager* frame_view_layout_manager_; |
| 42 views::Widget* widget_; | 56 views::Widget* widget_; |
| 43 bool maximized_; | 57 bool maximized_; |
| 44 gfx::Rect restored_bounds_; | 58 gfx::Rect restored_bounds_; |
| 59 aura::client::ActivationClient* activation_client_; |
| 60 mojo::WindowManagerApp* window_manager_app_; |
| 61 scoped_ptr<FrameEventHandler> frame_event_handler_; |
| 45 | 62 |
| 46 DISALLOW_COPY_AND_ASSIGN(FrameController); | 63 DISALLOW_COPY_AND_ASSIGN(FrameController); |
| 47 }; | 64 }; |
| 48 | 65 |
| 49 #endif // MOJO_EXAMPLES_WM_FLOW_WM_FRAME_CONTROLLER_H_ | 66 #endif // MOJO_EXAMPLES_WM_FLOW_WM_FRAME_CONTROLLER_H_ |
| OLD | NEW |