Chromium Code Reviews| 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 ash { | |
| 15 namespace test { | |
| 16 class SystemGestureEventFilterTest; | |
| 17 } // namespace test | |
| 18 } // namespace ash | |
|
sadrul
2014/05/15 22:47:34
You shouldn't add ash:: things in views.
You can
jonross
2014/05/16 18:59:48
Done.
| |
| 19 | |
| 20 namespace views { | |
| 21 | |
| 22 // Stores the ordering of window control buttons. Provides a default ordering | |
| 23 // of |FRAME_BUTTON_MINIMZE|, |FRAME_BUTTON_MAXIMIZE|, |FRAME_BUTTON_CLOSE|, | |
| 24 // where all controls are on the trailing end of a window. | |
| 25 // | |
| 26 // On Linux users can provide configuration files to control the ordering. This | |
| 27 // configuration is checked and overrides the defaults. | |
| 28 class VIEWS_EXPORT WindowButtonOrderProvider { | |
| 29 public: | |
| 30 static WindowButtonOrderProvider* GetInstance(); | |
| 31 | |
| 32 std::vector<views::FrameButton> const GetLeadingButtons() const; | |
| 33 std::vector<views::FrameButton> const GetTrailingButtons() const; | |
|
varkha
2014/05/15 23:33:18
Those could be leading_buttons() and trailing_butt
jonross
2014/05/16 18:59:48
Done.
| |
| 34 | |
| 35 protected: | |
| 36 WindowButtonOrderProvider(); | |
| 37 virtual ~WindowButtonOrderProvider(); | |
| 38 | |
| 39 void SetWindowButtonOrder( | |
| 40 const std::vector<views::FrameButton>& leading_buttons, | |
| 41 const std::vector<views::FrameButton>& trailing_buttons); | |
| 42 | |
| 43 private: | |
| 44 friend class CustomFrameViewTest; | |
| 45 friend class ash::test::SystemGestureEventFilterTest; | |
| 46 | |
| 47 static WindowButtonOrderProvider* instance_; | |
| 48 | |
| 49 // Layout arrangement of the window caption buttons. On linux these will be | |
| 50 // set via a WindowButtonOrderObserver. On other platforms a default | |
| 51 // arrangement of a trailing minimize, maximize, close, will be set. | |
| 52 std::vector<views::FrameButton> leading_buttons_; | |
| 53 std::vector<views::FrameButton> trailing_buttons_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(WindowButtonOrderProvider); | |
| 56 }; | |
| 57 | |
| 58 } // namespace views | |
| 59 | |
| 60 #endif // UI_VIEWS_WINDOW_WINDOW_BUTTON_ORDER_PROVIDER_H_ | |
| OLD | NEW |