Chromium Code Reviews| Index: ui/views/window/window_button_order_provider.h |
| diff --git a/ui/views/window/window_button_order_provider.h b/ui/views/window/window_button_order_provider.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2c0508470a0edc47672e2267234c1832b207bf66 |
| --- /dev/null |
| +++ b/ui/views/window/window_button_order_provider.h |
| @@ -0,0 +1,60 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_VIEWS_WINDOW_WINDOW_BUTTON_ORDER_PROVIDER_H_ |
| +#define UI_VIEWS_WINDOW_WINDOW_BUTTON_ORDER_PROVIDER_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/macros.h" |
| +#include "ui/views/views_export.h" |
| +#include "ui/views/window/frame_buttons.h" |
| + |
| +namespace ash { |
| +namespace test { |
| +class SystemGestureEventFilterTest; |
| +} // namespace test |
| +} // 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.
|
| + |
| +namespace views { |
| + |
| +// Stores the ordering of window control buttons. Provides a default ordering |
| +// of |FRAME_BUTTON_MINIMZE|, |FRAME_BUTTON_MAXIMIZE|, |FRAME_BUTTON_CLOSE|, |
| +// where all controls are on the trailing end of a window. |
| +// |
| +// On Linux users can provide configuration files to control the ordering. This |
| +// configuration is checked and overrides the defaults. |
| +class VIEWS_EXPORT WindowButtonOrderProvider { |
| + public: |
| + static WindowButtonOrderProvider* GetInstance(); |
| + |
| + std::vector<views::FrameButton> const GetLeadingButtons() const; |
| + 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.
|
| + |
| + protected: |
| + WindowButtonOrderProvider(); |
| + virtual ~WindowButtonOrderProvider(); |
| + |
| + void SetWindowButtonOrder( |
| + const std::vector<views::FrameButton>& leading_buttons, |
| + const std::vector<views::FrameButton>& trailing_buttons); |
| + |
| + private: |
| + friend class CustomFrameViewTest; |
| + friend class ash::test::SystemGestureEventFilterTest; |
| + |
| + static WindowButtonOrderProvider* instance_; |
| + |
| + // Layout arrangement of the window caption buttons. On linux these will be |
| + // set via a WindowButtonOrderObserver. On other platforms a default |
| + // arrangement of a trailing minimize, maximize, close, will be set. |
| + std::vector<views::FrameButton> leading_buttons_; |
| + std::vector<views::FrameButton> trailing_buttons_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WindowButtonOrderProvider); |
| +}; |
| + |
| +} // namespace views |
| + |
| +#endif // UI_VIEWS_WINDOW_WINDOW_BUTTON_ORDER_PROVIDER_H_ |