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

Side by Side Diff: chrome/browser/chromeos/drop_shadow_label.cc

Issue 8359029: ui/gfx: Convert Canvas::DrawFocusRect() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address Peter's review 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/views/dropdown_button.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/drop_shadow_label.h" 5 #include "chrome/browser/chromeos/drop_shadow_label.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "ui/gfx/canvas.h" 8 #include "ui/gfx/canvas.h"
9 #include "ui/gfx/color_utils.h" 9 #include "ui/gfx/color_utils.h"
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 } 48 }
49 49
50 canvas->DrawStringInt(text, font(), text_color, text_bounds.x(), 50 canvas->DrawStringInt(text, font(), text_color, text_bounds.x(),
51 text_bounds.y(), text_bounds.width(), text_bounds.height(), flags); 51 text_bounds.y(), text_bounds.width(), text_bounds.height(), flags);
52 52
53 if (HasFocus() || paint_as_focused()) { 53 if (HasFocus() || paint_as_focused()) {
54 gfx::Rect focus_bounds = text_bounds; 54 gfx::Rect focus_bounds = text_bounds;
55 focus_bounds.Inset(-Label::kFocusBorderPadding, 55 focus_bounds.Inset(-Label::kFocusBorderPadding,
56 -Label::kFocusBorderPadding); 56 -Label::kFocusBorderPadding);
57 canvas->DrawFocusRect(focus_bounds.x(), focus_bounds.y(), 57 canvas->DrawFocusRect(focus_bounds);
58 focus_bounds.width(), focus_bounds.height());
59 } 58 }
60 } 59 }
61 60
62 gfx::Size DropShadowLabel::GetTextSize() const { 61 gfx::Size DropShadowLabel::GetTextSize() const {
63 gfx::Size text_size = Label::GetTextSize(); 62 gfx::Size text_size = Label::GetTextSize();
64 text_size.SetSize(text_size.width() + drop_shadow_size_, 63 text_size.SetSize(text_size.width() + drop_shadow_size_,
65 text_size.height() + drop_shadow_size_); 64 text_size.height() + drop_shadow_size_);
66 return text_size; 65 return text_size;
67 } 66 }
68 67
69 } // namespace chromeos 68 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/views/dropdown_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698