OLD | NEW |
---|---|
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 Loading... | |
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())) |
Peter Kasting
2011/10/24 22:15:13
Nit: While here, add {}
tfarina
2011/10/25 02:04:53
Done.
| |
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 void DropDownButton::SetText(const string16& text) { | 80 void DropDownButton::SetText(const string16& text) { |
81 text_ = text; | 81 text_ = text; |
82 UpdateTextSize(); | 82 UpdateTextSize(); |
83 } | 83 } |
84 | 84 |
85 string16 DropDownButton::GetAccessibleValue() { | 85 string16 DropDownButton::GetAccessibleValue() { |
86 return text_; | 86 return text_; |
87 } | 87 } |
88 | 88 |
89 } // namespace chromeos | 89 } // namespace chromeos |
OLD | NEW |