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

Side by Side Diff: chrome/browser/chromeos/views/dropdown_button.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, 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
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/views/dropdown_button.h" 5 #include "chrome/browser/chromeos/views/dropdown_button.h"
6 6
7 #include "grit/theme_resources.h" 7 #include "grit/theme_resources.h"
8 #include "ui/base/resource/resource_bundle.h" 8 #include "ui/base/resource/resource_bundle.h"
9 #include "ui/gfx/canvas_skia.h" 9 #include "ui/gfx/canvas_skia.h"
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 views::ViewMenuDelegate* menu_delegate, 64 views::ViewMenuDelegate* menu_delegate,
65 bool show_menu_marker) 65 bool show_menu_marker)
66 : MenuButton(listener, text, menu_delegate, show_menu_marker) { 66 : MenuButton(listener, text, menu_delegate, show_menu_marker) {
67 set_border(new DropDownButtonBorder); 67 set_border(new DropDownButtonBorder);
68 } 68 }
69 69
70 DropDownButton::~DropDownButton() { 70 DropDownButton::~DropDownButton() {
71 } 71 }
72 72
73 void DropDownButton::OnPaintFocusBorder(gfx::Canvas* canvas) { 73 void DropDownButton::OnPaintFocusBorder(gfx::Canvas* canvas) {
74 if (HasFocus() && (IsFocusable() || IsAccessibilityFocusableInRootView())) 74 if (HasFocus() && (IsFocusable() || IsAccessibilityFocusableInRootView())) {
75 canvas->DrawFocusRect(kFocusFrameLeftOffset, kFocusFrameTopOffset, 75 canvas->DrawFocusRect(gfx::Rect(kFocusFrameLeftOffset, kFocusFrameTopOffset,
76 width() - kFocusFrameRightOffset, 76 width() - kFocusFrameRightOffset,
77 height() - kFocusFrameBottomOffset); 77 height() - kFocusFrameBottomOffset));
78 }
78 } 79 }
79 80
80 void DropDownButton::SetText(const string16& text) { 81 void DropDownButton::SetText(const string16& text) {
81 text_ = text; 82 text_ = text;
82 UpdateTextSize(); 83 UpdateTextSize();
83 } 84 }
84 85
85 string16 DropDownButton::GetAccessibleValue() { 86 string16 DropDownButton::GetAccessibleValue() {
86 return text_; 87 return text_;
87 } 88 }
88 89
89 } // namespace chromeos 90 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drop_shadow_label.cc ('k') | chrome/browser/ui/views/download/download_shelf_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698