summaryrefslogtreecommitdiffstats
path: root/ui/views/focus_border.h
blob: 15a3477883422e906470a992e5247b4988fc16c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// 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.

#ifndef UI_VIEWS_FOCUS_BORDER_H_
#define UI_VIEWS_FOCUS_BORDER_H_

#include "ui/views/views_export.h"
#include "base/basictypes.h"

namespace gfx {
class Canvas;
}

namespace views {
class View;

////////////////////////////////////////////////////////////////////////////////
//
// Focus border class.
//
// The focus border class is used to display an indication of focus on a view.
// To set a focus border on a view, call SetFocusBorder on the view.  Once set
// on a view, the focus border is owned by the view.
//
////////////////////////////////////////////////////////////////////////////////

class VIEWS_EXPORT FocusBorder {
 public:
  virtual ~FocusBorder();

  // Creates the default inset dashed line focus border.
  static FocusBorder* CreateDashedFocusBorder();
  static FocusBorder* CreateDashedFocusBorder(
      int left, int top, int right, int bottom);

  // Renders the focus border for the specified view.
  virtual void Paint(const View& view, gfx::Canvas* canvas) const = 0;

 protected:
  FocusBorder();

 private:
  DISALLOW_COPY_AND_ASSIGN(FocusBorder);
};

}  // namespace views

#endif  // UI_VIEWS_FOCUS_BORDER_H_