| OLD | NEW |
| 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 "ash/system/tray/tray_views.h" | 5 #include "ash/system/tray/tray_views.h" |
| 6 | 6 |
| 7 #include "ash/system/tray/tray_constants.h" | 7 #include "ash/system/tray/tray_constants.h" |
| 8 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
| 9 #include "grit/ash_strings.h" | 9 #include "grit/ash_strings.h" |
| 10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 return PerformAction(event); | 66 return PerformAction(event); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void ActionableView::OnPaintFocusBorder(gfx::Canvas* canvas) { | 69 void ActionableView::OnPaintFocusBorder(gfx::Canvas* canvas) { |
| 70 if (HasFocus() && (focusable() || IsAccessibilityFocusable())) { | 70 if (HasFocus() && (focusable() || IsAccessibilityFocusable())) { |
| 71 canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3), | 71 canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3), |
| 72 kFocusBorderColor); | 72 kFocusBorderColor); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 void ActionableView::GetAccessibleState(ui::AccessibleViewState* state) { |
| 77 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
| 78 state->name = accessible_name_; |
| 79 } |
| 80 |
| 81 void ActionableView::SetAccessibleName(const string16& name) { |
| 82 accessible_name_ = name; |
| 83 } |
| 84 |
| 76 //////////////////////////////////////////////////////////////////////////////// | 85 //////////////////////////////////////////////////////////////////////////////// |
| 77 // HoverHighlightView | 86 // HoverHighlightView |
| 78 | 87 |
| 79 HoverHighlightView::HoverHighlightView(ViewClickListener* listener) | 88 HoverHighlightView::HoverHighlightView(ViewClickListener* listener) |
| 80 : listener_(listener), | 89 : listener_(listener), |
| 81 highlight_color_(kHoverBackgroundColor), | 90 highlight_color_(kHoverBackgroundColor), |
| 82 default_color_(0), | 91 default_color_(0), |
| 83 fixed_height_(0), | 92 fixed_height_(0), |
| 84 hover_(false) { | 93 hover_(false) { |
| 85 set_notify_enter_exit_on_child(true); | 94 set_notify_enter_exit_on_child(true); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 label->SetAutoColorReadabilityEnabled(false); | 349 label->SetAutoColorReadabilityEnabled(false); |
| 341 label->SetEnabledColor(SK_ColorWHITE); | 350 label->SetEnabledColor(SK_ColorWHITE); |
| 342 label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255)); | 351 label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255)); |
| 343 label->SetShadowColors(SkColorSetARGB(64, 0, 0, 0), | 352 label->SetShadowColors(SkColorSetARGB(64, 0, 0, 0), |
| 344 SkColorSetARGB(64, 0, 0, 0)); | 353 SkColorSetARGB(64, 0, 0, 0)); |
| 345 label->SetShadowOffset(0, 1); | 354 label->SetShadowOffset(0, 1); |
| 346 } | 355 } |
| 347 | 356 |
| 348 } // namespace internal | 357 } // namespace internal |
| 349 } // namespace ash | 358 } // namespace ash |
| OLD | NEW |