Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Side by Side Diff: ui/views/window/window_button_order_provider.h

Issue 281353009: Reland Linux Window Control Alignment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix another test Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698