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

Unified Diff: ui/views/controls/focusable_border.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 months 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 | « ui/views/controls/focusable_border.h ('k') | ui/views/controls/glow_hover_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/focusable_border.cc
diff --git a/ui/views/controls/focusable_border.cc b/ui/views/controls/focusable_border.cc
deleted file mode 100644
index 0e4f3a2f73406027e5c57e0440734e8163d7e5b3..0000000000000000000000000000000000000000
--- a/ui/views/controls/focusable_border.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2012 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/focusable_border.h"
-
-#include "ui/gfx/canvas.h"
-#include "ui/gfx/insets.h"
-#include "ui/gfx/skia_util.h"
-#include "ui/native_theme/native_theme.h"
-
-namespace {
-
-const int kInsetSize = 1;
-
-} // namespace
-
-namespace views {
-
-FocusableBorder::FocusableBorder()
- : insets_(kInsetSize, kInsetSize, kInsetSize, kInsetSize),
- override_color_(SK_ColorWHITE),
- use_default_color_(true) {
-}
-
-FocusableBorder::~FocusableBorder() {
-}
-
-void FocusableBorder::SetColor(SkColor color) {
- override_color_ = color;
- use_default_color_ = false;
-}
-
-void FocusableBorder::UseDefaultColor() {
- use_default_color_ = true;
-}
-
-void FocusableBorder::Paint(const View& view, gfx::Canvas* canvas) {
- SkPath path;
- path.addRect(gfx::RectToSkRect(view.GetLocalBounds()), SkPath::kCW_Direction);
- SkPaint paint;
- paint.setStyle(SkPaint::kStroke_Style);
- SkColor color = override_color_;
- if (use_default_color_) {
- color = view.GetNativeTheme()->GetSystemColor(
- view.HasFocus() ? ui::NativeTheme::kColorId_FocusedBorderColor :
- ui::NativeTheme::kColorId_UnfocusedBorderColor);
- }
-
- paint.setColor(color);
- paint.setStrokeWidth(SkIntToScalar(2));
-
- canvas->DrawPath(path, paint);
-}
-
-gfx::Insets FocusableBorder::GetInsets() const {
- return insets_;
-}
-
-gfx::Size FocusableBorder::GetMinimumSize() const {
- return gfx::Size();
-}
-
-void FocusableBorder::SetInsets(int top, int left, int bottom, int right) {
- insets_.Set(top, left, bottom, right);
-}
-
-} // namespace views
« no previous file with comments | « ui/views/controls/focusable_border.h ('k') | ui/views/controls/glow_hover_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698