| Index: ui/views/layout/views_layout_delegate.h
|
| diff --git a/ui/views/layout/views_layout_delegate.h b/ui/views/layout/views_layout_delegate.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9d147346f8e03099156be63b37bcfc84a0a0c4b7
|
| --- /dev/null
|
| +++ b/ui/views/layout/views_layout_delegate.h
|
| @@ -0,0 +1,70 @@
|
| +// Copyright 2017 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 UI_VIEWS_LAYOUT_VIEWS_LAYOUT_DELEGATE_H_
|
| +#define UI_VIEWS_LAYOUT_VIEWS_LAYOUT_DELEGATE_H_
|
| +
|
| +#include "base/macros.h"
|
| +#include "ui/gfx/geometry/insets.h"
|
| +#include "ui/views/style/typography_provider.h"
|
| +#include "ui/views/views_export.h"
|
| +
|
| +namespace views {
|
| +
|
| +enum class InsetsMetric {
|
| + // The margins that should be applied around a bubble dialog.
|
| + BUBBLE_DIALOG,
|
| + // The insets that should be applied around a DialogClientView. Note that
|
| + // the top inset is used for the distance between the buttons and the
|
| + // DialogClientView's content view.
|
| + DIALOG_BUTTON,
|
| + // The insets that should be applied around a dialog's frame view.
|
| + DIALOG_FRAME_VIEW,
|
| +};
|
| +
|
| +enum class DistanceMetric {
|
| + // The default padding to add on each side of a button's label.
|
| + BUTTON_HORIZONTAL_PADDING,
|
| + // The distance between a dialog's edge and the close button in the upper
|
| + // trailing corner.
|
| + CLOSE_BUTTON_MARGIN,
|
| + // The default minimum width of a dialog button.
|
| + DIALOG_BUTTON_MINIMUM_WIDTH,
|
| + // The spacing between a pair of related horizontal buttons, used for
|
| + // dialog layout.
|
| + RELATED_BUTTON_HORIZONTAL,
|
| + // Horizontal spacing between controls that are logically related.
|
| + RELATED_CONTROL_HORIZONTAL,
|
| + // The spacing between a pair of related vertical controls, used for
|
| + // dialog layout.
|
| + RELATED_CONTROL_VERTICAL,
|
| +};
|
| +
|
| +class VIEWS_EXPORT ViewsLayoutDelegate {
|
| + public:
|
| + ViewsLayoutDelegate();
|
| + virtual ~ViewsLayoutDelegate();
|
| +
|
| + static ViewsLayoutDelegate* Get();
|
| +
|
| + // Returns the insets metric according to the given enumeration element.
|
| + virtual gfx::Insets GetInsetsMetric(InsetsMetric metric) const;
|
| +
|
| + // Returns the distance metric between elements according to the given
|
| + // enumeration element.
|
| + virtual int GetDistanceMetric(DistanceMetric metric) const;
|
| +
|
| + // Returns the TypographyProvider, used to configure text properties such as
|
| + // font, weight, color, size, and line height. Never null.
|
| + virtual const TypographyProvider& GetTypographyProvider() const;
|
| +
|
| + private:
|
| + DefaultTypographyProvider typography_provider_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ViewsLayoutDelegate);
|
| +};
|
| +
|
| +} // namespace views
|
| +
|
| +#endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_
|
|
|