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

Side by Side Diff: ui/views/focus_border.cc

Issue 10933085: Update ConstrainedWindowViews appearance according to mock (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Browser test fixes Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/views/focus_border.h"
6
7 #include "ui/gfx/canvas.h"
8 #include "ui/gfx/rect.h"
9 #include "ui/views/view.h"
10
11 namespace views {
12 namespace {
13 class DashedFocusBorder : public FocusBorder {
14 public:
15 DashedFocusBorder(
16 int left_inset, int top_inset, int right_inset, int bottom_inset)
17 : left_inset_(left_inset),
18 top_inset_(top_inset),
19 right_inset_(right_inset),
20 bottom_inset_(bottom_inset) {
21 }
22
23 virtual void Paint(const View& view, gfx::Canvas* canvas) const {
24 gfx::Rect rect(view.GetLocalBounds());
25 rect.Inset(left_inset_, top_inset_, right_inset_, bottom_inset_);
26 canvas->DrawFocusRect(rect);
27 }
28
29 private:
30 int left_inset_;
31 int top_inset_;
32 int right_inset_;
33 int bottom_inset_;
34
35 DISALLOW_COPY_AND_ASSIGN(DashedFocusBorder);
36 };
37 } // namespace
38
39 FocusBorder::~FocusBorder() {
40 }
41
42 // static
43 FocusBorder* FocusBorder::CreateDashedFocusBorder() {
44 return new DashedFocusBorder(0, 0, 0, 0);
45 }
46
47 // static
48 FocusBorder* FocusBorder::CreateDashedFocusBorder(
49 int left, int top, int right, int bottom) {
50 return new DashedFocusBorder(left, top, right, bottom);
51 }
52
53 FocusBorder::FocusBorder() {
54 }
55
56 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698