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

Unified Diff: ash/system/tray/tray_views.cc

Issue 10815082: ash: Make sure the focus-border in the tray paints correctly, and tray-view should not be focusable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/tray/tray_views.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/tray_views.cc
diff --git a/ash/system/tray/tray_views.cc b/ash/system/tray/tray_views.cc
index 55081400c298d97399ab5e1b02022142e7afd471..c62b3f5418b711590d7fb3df3dd7737849386f0d 100644
--- a/ash/system/tray/tray_views.cc
+++ b/ash/system/tray/tray_views.cc
@@ -109,6 +109,12 @@ ActionableView::ActionableView()
ActionableView::~ActionableView() {
}
+void ActionableView::DrawBorder(gfx::Canvas* canvas, const gfx::Rect& bounds) {
+ gfx::Rect rect = bounds;
+ rect.Inset(1, 1, 3, 3);
+ canvas->DrawRect(rect, kFocusBorderColor);
+}
+
bool ActionableView::OnKeyPressed(const views::KeyEvent& event) {
if (event.key_code() == ui::VKEY_SPACE ||
event.key_code() == ui::VKEY_RETURN) {
@@ -137,10 +143,8 @@ void ActionableView::SetAccessibleName(const string16& name) {
}
void ActionableView::OnPaintFocusBorder(gfx::Canvas* canvas) {
- if (HasFocus() && (focusable() || IsAccessibilityFocusable())) {
- canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3),
- kFocusBorderColor);
- }
+ if (HasFocus() && (focusable() || IsAccessibilityFocusable()))
+ DrawBorder(canvas, GetLocalBounds());
}
ui::GestureStatus ActionableView::OnGestureEvent(
« no previous file with comments | « ash/system/tray/tray_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698