#ifndef CHROME_BROWSER_VR_ELEMENTS_LINEAR_LAYOUT_H_
#define CHROME_BROWSER_VR_ELEMENTS_LINEAR_LAYOUT_H_
#include "chrome/browser/vr/elements/ui_element.h"
#include "chrome/browser/vr/vr_ui_export.h"
namespace vr {
class VR_UI_EXPORT LinearLayout : public UiElement {
public:
enum Direction { kUp, kDown, kLeft, kRight };
explicit LinearLayout(Direction direction);
~LinearLayout() override;
void set_margin(float margin) { margin_ = margin; }
void set_direction(Direction direction) { direction_ = direction; }
void LayOutContributingChildren() override;
private:
bool Horizontal() const;
void GetTotalExtent(const UiElement* element_to_exclude,
float* major_extent,
float* minor_extent) const;
Direction direction_;
float margin_ = 0.0f;
};
}
#endif