OLD | NEW |
(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_UTILS_H_ |
| 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_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. This |
| 46 // should be used by all rows that require a label, i.e. both default and |
| 47 // detailed rows should use this. |
| 48 // |
| 49 // TODO(bruthig): Update all system menu rows to use this. |
| 50 static views::Label* CreateDefaultLabel(); |
| 51 |
| 52 // Returns an image view to be used for the main image of a system menu row. |
| 53 // This should be used by all rows that have a main image, i.e. both default |
| 54 // and detailed rows should use this. |
| 55 // |
| 56 // TODO(bruthig): Update all system menu rows to use this. |
| 57 static views::ImageView* CreateMainImageView(); |
| 58 |
| 59 // Returns an image view to be used for the 'more' arrow image on rows. In |
| 60 // general this applies to all rows in the system menu that have a 'more' |
| 61 // image however most, if not all, are default rows. |
| 62 // |
| 63 // TODO(bruthig): Update all default rows to use this. |
| 64 static views::ImageView* CreateMoreImageView(); |
| 65 |
| 66 private: |
| 67 TrayPopupUtils() = delete; |
| 68 ~TrayPopupUtils() = delete; |
| 69 |
| 70 // Configures the specified |container| view with the default layout. Used by |
| 71 // CreateDefaultRowView(). |
| 72 static void ConfigureDefaultLayout(TriView* tri_view, |
| 73 TriView::Container container); |
| 74 }; |
| 75 |
| 76 } // namespace ash |
| 77 |
| 78 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ |
OLD | NEW |