summaryrefslogtreecommitdiffstats
path: root/ui/views/controls/separator.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-29 20:25:29 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-29 20:25:29 +0000
commit8fc1b372c1f74f06296a0eebee0d40dbd623332f (patch)
treedde0e7d9c71dd2e461c0860e9ebe61e4a9ea385f /ui/views/controls/separator.cc
parentde797cf7fd9f68c59b636a26f1ade2e01357d8e9 (diff)
downloadchromium_src-8fc1b372c1f74f06296a0eebee0d40dbd623332f.zip
chromium_src-8fc1b372c1f74f06296a0eebee0d40dbd623332f.tar.gz
chromium_src-8fc1b372c1f74f06296a0eebee0d40dbd623332f.tar.bz2
views: Move the remaining files to ui/views/controls/.
BUG=104039 R=ben@chromium.org TBR=stevenjb@chromium.org Review URL: http://codereview.chromium.org/8687031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112014 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/controls/separator.cc')
-rw-r--r--ui/views/controls/separator.cc47
1 files changed, 47 insertions, 0 deletions
diff --git a/ui/views/controls/separator.cc b/ui/views/controls/separator.cc
new file mode 100644
index 0000000..2842068
--- /dev/null
+++ b/ui/views/controls/separator.cc
@@ -0,0 +1,47 @@
+// Copyright (c) 2011 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.
+
+#include "ui/views/controls/separator.h"
+
+#include "ui/base/accessibility/accessible_view_state.h"
+#include "ui/gfx/canvas.h"
+
+namespace views {
+
+// static
+const char Separator::kViewClassName[] = "views/Separator";
+
+// The separator height in pixels.
+const int kSeparatorHeight = 1;
+
+// Default color of the separator.
+const SkColor kDefaultColor = SkColorSetARGB(255, 233, 233, 233);
+
+Separator::Separator() {
+ set_focusable(false);
+}
+
+Separator::~Separator() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Separator, View overrides:
+
+gfx::Size Separator::GetPreferredSize() {
+ return gfx::Size(width(), kSeparatorHeight);
+}
+
+void Separator::GetAccessibleState(ui::AccessibleViewState* state) {
+ state->role = ui::AccessibilityTypes::ROLE_SEPARATOR;
+}
+
+void Separator::Paint(gfx::Canvas* canvas) {
+ canvas->FillRect(kDefaultColor, bounds());
+}
+
+std::string Separator::GetClassName() const {
+ return kViewClassName;
+}
+
+} // namespace views