This source file includes following definitions.
- GetPreferredSize
- GetAccessibleState
- Paint
- GetClassName
#include "ui/views/controls/separator.h"
#include "ui/accessibility/ax_view_state.h"
#include "ui/gfx/canvas.h"
namespace views {
const char Separator::kViewClassName[] = "Separator";
const int kSeparatorHeight = 1;
const SkColor kDefaultColor = SkColorSetARGB(255, 233, 233, 233);
Separator::Separator(Orientation orientation) : orientation_(orientation) {
SetFocusable(false);
}
Separator::~Separator() {
}
gfx::Size Separator::GetPreferredSize() {
if (orientation_ == HORIZONTAL)
return gfx::Size(width(), kSeparatorHeight);
return gfx::Size(kSeparatorHeight, height());
}
void Separator::GetAccessibleState(ui::AXViewState* state) {
state->role = ui::AX_ROLE_SPLITTER;
}
void Separator::Paint(gfx::Canvas* canvas) {
canvas->FillRect(bounds(), kDefaultColor);
}
const char* Separator::GetClassName() const {
return kViewClassName;
}
}