Drive: Add BatchableRequest subclass.
[chromium-blink-merge.git] / ui / views / window / window_button_order_provider.h
blobf50a49f0fb780f9a853163ec9d699f89b21e1acf
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.
5 #ifndef UI_VIEWS_WINDOW_WINDOW_BUTTON_ORDER_PROVIDER_H_
6 #define UI_VIEWS_WINDOW_WINDOW_BUTTON_ORDER_PROVIDER_H_
8 #include <vector>
10 #include "base/macros.h"
11 #include "ui/views/views_export.h"
12 #include "ui/views/window/frame_buttons.h"
14 namespace views {
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.
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();
26 const std::vector<views::FrameButton>& leading_buttons() const {
27 return leading_buttons_;
30 const std::vector<views::FrameButton>& trailing_buttons() const {
31 return trailing_buttons_;
34 void SetWindowButtonOrder(
35 const std::vector<views::FrameButton>& leading_buttons,
36 const std::vector<views::FrameButton>& trailing_buttons);
38 protected:
39 WindowButtonOrderProvider();
40 virtual ~WindowButtonOrderProvider();
42 private:
43 static WindowButtonOrderProvider* instance_;
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_;
51 DISALLOW_COPY_AND_ASSIGN(WindowButtonOrderProvider);
54 } // namespace views
56 #endif // UI_VIEWS_WINDOW_WINDOW_BUTTON_ORDER_PROVIDER_H_