Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1369)

Unified Diff: views/controls/focusable_border.cc

Issue 8687031: views: Move the remaining files to ui/views/controls/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/controls/focusable_border.h ('k') | views/controls/image_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/focusable_border.cc
diff --git a/views/controls/focusable_border.cc b/views/controls/focusable_border.cc
deleted file mode 100644
index 76815396d57f58e68458b211a105a61a1c2e9ff6..0000000000000000000000000000000000000000
--- a/views/controls/focusable_border.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// 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 "views/controls/focusable_border.h"
-
-#include "ui/gfx/canvas.h"
-#include "ui/gfx/canvas_skia.h"
-#include "ui/gfx/insets.h"
-
-namespace {
-
-// Define the size of the insets
-const int kTopInsetSize = 4;
-const int kLeftInsetSize = 4;
-const int kBottomInsetSize = 4;
-const int kRightInsetSize = 4;
-
-// Color settings for border.
-// These are tentative, and should be derived from theme, system
-// settings and current settings.
-const SkColor kFocusedBorderColor = SK_ColorCYAN;
-const SkColor kDefaultBorderColor = SK_ColorGRAY;
-
-} // namespace
-
-namespace views {
-
-FocusableBorder::FocusableBorder()
- : has_focus_(false),
- insets_(kTopInsetSize, kLeftInsetSize,
- kBottomInsetSize, kRightInsetSize) {
-}
-
-void FocusableBorder::Paint(const View& view, gfx::Canvas* canvas) const {
- SkRect rect;
- rect.set(SkIntToScalar(0), SkIntToScalar(0),
- SkIntToScalar(view.width()), SkIntToScalar(view.height()));
- SkScalar corners[8] = {
- // top-left
- SkIntToScalar(insets_.left()),
- SkIntToScalar(insets_.top()),
- // top-right
- SkIntToScalar(insets_.right()),
- SkIntToScalar(insets_.top()),
- // bottom-right
- SkIntToScalar(insets_.right()),
- SkIntToScalar(insets_.bottom()),
- // bottom-left
- SkIntToScalar(insets_.left()),
- SkIntToScalar(insets_.bottom()),
- };
- SkPath path;
- path.addRoundRect(rect, corners);
- SkPaint paint;
- paint.setStyle(SkPaint::kStroke_Style);
- paint.setFlags(SkPaint::kAntiAlias_Flag);
- // TODO(oshima): Copy what WebKit does for focused border.
- paint.setColor(has_focus_ ? kFocusedBorderColor : kDefaultBorderColor);
- paint.setStrokeWidth(SkIntToScalar(has_focus_ ? 2 : 1));
-
- canvas->GetSkCanvas()->drawPath(path, paint);
-}
-
-void FocusableBorder::GetInsets(gfx::Insets* insets) const {
- *insets = insets_;
-}
-
-void FocusableBorder::SetInsets(int top, int left, int bottom, int right) {
- insets_.Set(top, left, bottom, right);
-}
-
-} // namespace views
« no previous file with comments | « views/controls/focusable_border.h ('k') | views/controls/image_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698