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

Side by Side Diff: ash/common/system/tray/tray_popup_utils.h

Issue 2468533002: [ash-md] Applied Material Design layout to TrayItemMore system menu rows. (Closed)
Patch Set: Merge branch 'master' into md_system_menu_tray_item_more_layout Created 4 years, 1 month 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 2016 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 ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTIL_H_
tdanderson 2016/11/01 18:59:44 nit: UTILS_H_ rather than UTIL_H_
bruthig 2016/11/01 23:00:43 Done.
6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTIL_H_
7
8 #include "ash/common/system/tray/tri_view.h"
9 #include "base/strings/string16.h"
10
11 namespace views {
12 class ButtonListener;
13 class ImageView;
14 class Label;
15 class LabelButton;
16 class LayoutManager;
17 class Slider;
18 class SliderListener;
19 } // namespace views
20
21 namespace ash {
22
23 // Factory/utility functions used by the system menu.
24 class TrayPopupUtils {
25 public:
26 // Creates a default container view to be used most system menu rows. The
27 // caller takes over ownership of the created view.
28 //
29 // The returned view consists of 3 regions: START, CENTER, and END. Any child
30 // Views added to the START and END containers will be added horizonatlly and
31 // any Views added to the CENTER container will be added vertically.
32 //
33 // The START and END containers have a fixed width but can grow into the
34 // CENTER container if space is required and available.
35 //
36 // The CENTER container has a flexible width.
37 static TriView* CreateDefaultRowView();
38
39 // Creates the default layout manager by CreateDefault() row for the given
40 // |container|. To be used when mutliple targetable areas are required within
41 // a single row.
42 static std::unique_ptr<views::LayoutManager> CreateLayoutManager(
43 TriView::Container container);
44
45 // Returns a label that has been configured for system menu layout.
tdanderson 2016/11/01 18:59:44 Similar to the comments I made in the constants fi
bruthig 2016/11/01 23:00:43 Done.
46 //
47 // TODO(bruthig): Update all system menu rows to use this.
48 static views::Label* CreateDefaultLabel();
49
50 // Returns an image view to be used for the main image of a system menu row.
51 //
52 // TODO(bruthig): Update all system menu rows to use this.
53 static views::ImageView* CreateMainImageView();
54
55 // Returns an image view to be used for the 'more' arrow image on default
56 // rows.
57 //
58 // TODO(bruthig): Update all default rows to use this.
59 static views::ImageView* CreateMoreImageView();
60
61 private:
62 TrayPopupUtils() = delete;
63 ~TrayPopupUtils() = delete;
64
65 // Configures the specified |container| view with the default layout. Used by
66 // CreateDefaultRowView().
67 static void ConfigureDefaultLayout(TriView* tri_view,
68 TriView::Container container);
69 };
70
71 } // namespace ash
72
73 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698