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 UI_VIEWS_WINDOW_WINDOW_BUTTON_ORDER_PROVIDER_H_ |
| 6 #define UI_VIEWS_WINDOW_WINDOW_BUTTON_ORDER_PROVIDER_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "ui/views/views_export.h" |
| 12 #include "ui/views/window/frame_buttons.h" |
| 13 |
| 14 namespace views { |
| 15 |
| 16 // Stores the ordering of window control buttons. Provides a default ordering |
| 17 // of |FRAME_BUTTON_MINIMZE|, |FRAME_BUTTON_MAXIMIZE|, |FRAME_BUTTON_CLOSE|, |
| 18 // where all controls are on the trailing end of a window. |
| 19 // |
| 20 // On Linux users can provide configuration files to control the ordering. This |
| 21 // configuration is checked and overrides the defaults. |
| 22 class VIEWS_EXPORT WindowButtonOrderProvider { |
| 23 public: |
| 24 static WindowButtonOrderProvider* GetInstance(); |
| 25 |
| 26 const std::vector<views::FrameButton>& leading_buttons() const { |
| 27 return leading_buttons_; |
| 28 } |
| 29 |
| 30 const std::vector<views::FrameButton>& trailing_buttons() const { |
| 31 return trailing_buttons_; |
| 32 } |
| 33 |
| 34 void SetWindowButtonOrder( |
| 35 const std::vector<views::FrameButton>& leading_buttons, |
| 36 const std::vector<views::FrameButton>& trailing_buttons); |
| 37 |
| 38 protected: |
| 39 WindowButtonOrderProvider(); |
| 40 virtual ~WindowButtonOrderProvider(); |
| 41 |
| 42 private: |
| 43 static WindowButtonOrderProvider* instance_; |
| 44 |
| 45 // Layout arrangement of the window caption buttons. On linux these will be |
| 46 // set via a WindowButtonOrderObserver. On other platforms a default |
| 47 // arrangement of a trailing minimize, maximize, close, will be set. |
| 48 std::vector<views::FrameButton> leading_buttons_; |
| 49 std::vector<views::FrameButton> trailing_buttons_; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(WindowButtonOrderProvider); |
| 52 }; |
| 53 |
| 54 } // namespace views |
| 55 |
| 56 #endif // UI_VIEWS_WINDOW_WINDOW_BUTTON_ORDER_PROVIDER_H_ |
OLD | NEW |