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

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

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/border.h" 5 #include "ui/views/border.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/views/painter.h" 10 #include "ui/views/painter.h"
(...skipping 26 matching lines...) Expand all
37 int right, 37 int right,
38 SkColor color) 38 SkColor color)
39 : color_(color), 39 : color_(color),
40 insets_(top, left, bottom, right) { 40 insets_(top, left, bottom, right) {
41 } 41 }
42 42
43 void SidedSolidBorder::Paint(const View& view, gfx::Canvas* canvas) { 43 void SidedSolidBorder::Paint(const View& view, gfx::Canvas* canvas) {
44 // Top border. 44 // Top border.
45 canvas->FillRect(gfx::Rect(0, 0, view.width(), insets_.top()), color_); 45 canvas->FillRect(gfx::Rect(0, 0, view.width(), insets_.top()), color_);
46 // Left border. 46 // Left border.
47 canvas->FillRect(gfx::Rect(0, 0, insets_.left(), view.height()), color_); 47 canvas->FillRect(gfx::Rect(0, insets_.top(), insets_.left(),
48 view.height() - insets_.height()), color_);
48 // Bottom border. 49 // Bottom border.
49 canvas->FillRect(gfx::Rect(0, view.height() - insets_.bottom(), view.width(), 50 canvas->FillRect(gfx::Rect(0, view.height() - insets_.bottom(), view.width(),
50 insets_.bottom()), color_); 51 insets_.bottom()), color_);
51 // Right border. 52 // Right border.
52 canvas->FillRect(gfx::Rect(view.width() - insets_.right(), 0, insets_.right(), 53 canvas->FillRect(gfx::Rect(view.width() - insets_.right(), insets_.top(),
53 view.height()), color_); 54 insets_.right(), view.height() - insets_.height()),
55 color_);
54 } 56 }
55 57
56 gfx::Insets SidedSolidBorder::GetInsets() const { 58 gfx::Insets SidedSolidBorder::GetInsets() const {
57 return insets_; 59 return insets_;
58 } 60 }
59 61
60 gfx::Size SidedSolidBorder::GetMinimumSize() const { 62 gfx::Size SidedSolidBorder::GetMinimumSize() const {
61 return gfx::Size(insets_.width(), insets_.height()); 63 return gfx::Size(insets_.width(), insets_.height());
62 } 64 }
63 65
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 return make_scoped_ptr(new SidedSolidBorder(top, left, bottom, right, color)); 155 return make_scoped_ptr(new SidedSolidBorder(top, left, bottom, right, color));
154 } 156 }
155 157
156 // static 158 // static
157 scoped_ptr<Border> Border::CreateBorderPainter(Painter* painter, 159 scoped_ptr<Border> Border::CreateBorderPainter(Painter* painter,
158 const gfx::Insets& insets) { 160 const gfx::Insets& insets) {
159 return make_scoped_ptr(new BorderPainter(painter, insets)); 161 return make_scoped_ptr(new BorderPainter(painter, insets));
160 } 162 }
161 163
162 } // namespace views 164 } // namespace views
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/test/mock_drm_device.cc ('k') | ui/views/controls/menu/menu_event_dispatcher_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698