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