Chromium Code Reviews| Index: ash/common/system/tray/tray_popup_layout_factory.h |
| diff --git a/ash/common/system/tray/tray_popup_layout_factory.h b/ash/common/system/tray/tray_popup_layout_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5e5669eb93d48fe182ab829f34503c081505947d |
| --- /dev/null |
| +++ b/ash/common/system/tray/tray_popup_layout_factory.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright 2016 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 ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_LAYOUT_FACTORY_H_ |
| +#define ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_LAYOUT_FACTORY_H_ |
| + |
| +#include <memory> |
| + |
| +#include "ash/common/system/tray/three_view_layout.h" |
| +#include "base/macros.h" |
| + |
| +namespace views { |
| +class View; |
| +} // namespace views |
| + |
| +namespace ash { |
| + |
| +// Factory functions for system menu row layout managers. |
| +class TrayPopupLayoutFactory { |
| + public: |
| + // Sets the layout manager of |host| to the default layout manager used by |
| + // most system menu rows. The newly created layout manager is owned by the |
| + // |host| but is returned so child Views can be added. |
| + // |
| + // The returned layout manager consists of 3 regions: START, CENTER, and END. |
| + // Any child Views added to the START and END containers will be added |
| + // horizonatlly and any Views added to the CENTER container will be added |
| + // vertically. |
| + // |
| + // The START and END containers have a fixed width but can grow into the |
| + // CENTER container if space is required and available. |
| + // |
| + // The CENTER container has a flexible width. |
| + static ThreeViewLayout* InstallDefaultLayout(views::View* host); |
| + |
| + // Configures the different |container| Views with the default layout |
| + // managers. |
| + // |
| + // This can be used by clients who need to embed portions of the default |
| + // layout manager into a different container view, e.g. just the END layout |
| + // into a clickable View. |
| + static void ConfigureDefaultLayout(ThreeViewLayout* layout, |
|
tdanderson
2016/10/19 18:31:00
Maybe it's the function name or the description, b
bruthig
2016/10/20 04:40:13
I envision this being used by menu rows that have
tdanderson
2016/10/20 18:16:49
Following up on our discussion in person, let's de
bruthig
2016/10/20 19:01:34
Acknowledged.
|
| + ThreeViewLayout::Container container); |
| + |
| + private: |
| + TrayPopupLayoutFactory(); |
| + ~TrayPopupLayoutFactory(); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(TrayPopupLayoutFactory); |
| +}; |
| + |
| +} // namespace ash |
| + |
| +#endif // ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_LAYOUT_FACTORY_H_ |