| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 MASH_WM_NON_CLIENT_FRAME_CONTROLLER_H_ | 5 #ifndef MASH_WM_NON_CLIENT_FRAME_CONTROLLER_H_ |
| 6 #define MASH_WM_NON_CLIENT_FRAME_CONTROLLER_H_ | 6 #define MASH_WM_NON_CLIENT_FRAME_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace mash { | 28 namespace mash { |
| 29 namespace wm { | 29 namespace wm { |
| 30 | 30 |
| 31 // Provides the non-client frame for mus Windows. | 31 // Provides the non-client frame for mus Windows. |
| 32 class NonClientFrameController : public views::WidgetDelegateView, | 32 class NonClientFrameController : public views::WidgetDelegateView, |
| 33 public mus::WindowObserver { | 33 public mus::WindowObserver { |
| 34 public: | 34 public: |
| 35 // NonClientFrameController deletes itself when |window| is destroyed. | 35 // NonClientFrameController deletes itself when |window| is destroyed. |
| 36 NonClientFrameController(mojo::Connector* connector, | 36 static void Create(mojo::Connector* connector, |
| 37 mus::Window* window, | 37 mus::Window* window, |
| 38 mus::WindowManagerClient* window_manager_client); | 38 mus::WindowManagerClient* window_manager_client); |
| 39 | 39 |
| 40 // Returns the preferred client area insets. | 40 // Returns the preferred client area insets. |
| 41 static gfx::Insets GetPreferredClientAreaInsets(); | 41 static gfx::Insets GetPreferredClientAreaInsets(); |
| 42 | 42 |
| 43 // Returns the width needed to display the standard set of buttons on the | 43 // Returns the width needed to display the standard set of buttons on the |
| 44 // title bar. | 44 // title bar. |
| 45 static int GetMaxTitleBarButtonWidth(); | 45 static int GetMaxTitleBarButtonWidth(); |
| 46 | 46 |
| 47 mus::Window* window() { return window_; } | 47 mus::Window* window() { return window_; } |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 NonClientFrameController(mojo::Connector* connector, |
| 51 mus::Window* window, |
| 52 mus::WindowManagerClient* window_manager_client); |
| 50 ~NonClientFrameController() override; | 53 ~NonClientFrameController() override; |
| 51 | 54 |
| 52 // views::WidgetDelegateView: | 55 // views::WidgetDelegateView: |
| 53 base::string16 GetWindowTitle() const override; | 56 base::string16 GetWindowTitle() const override; |
| 54 views::View* GetContentsView() override; | 57 views::View* GetContentsView() override; |
| 55 bool CanResize() const override; | 58 bool CanResize() const override; |
| 56 bool CanMaximize() const override; | 59 bool CanMaximize() const override; |
| 57 bool CanMinimize() const override; | 60 bool CanMinimize() const override; |
| 58 views::ClientView* CreateClientView(views::Widget* widget) override; | 61 views::ClientView* CreateClientView(views::Widget* widget) override; |
| 59 | 62 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 71 // is null. | 74 // is null. |
| 72 mus::Window* window_; | 75 mus::Window* window_; |
| 73 | 76 |
| 74 DISALLOW_COPY_AND_ASSIGN(NonClientFrameController); | 77 DISALLOW_COPY_AND_ASSIGN(NonClientFrameController); |
| 75 }; | 78 }; |
| 76 | 79 |
| 77 } // namespace wm | 80 } // namespace wm |
| 78 } // namespace mash | 81 } // namespace mash |
| 79 | 82 |
| 80 #endif // MASH_WM_NON_CLIENT_FRAME_CONTROLLER_H_ | 83 #endif // MASH_WM_NON_CLIENT_FRAME_CONTROLLER_H_ |
| OLD | NEW |