| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_popup_header_button.h" | 5 #include "ash/system/tray/tray_popup_header_button.h" |
| 6 | 6 |
| 7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
| 8 #include "ash/system/tray/tray_constants.h" | 8 #include "ash/system/tray/tray_constants.h" |
| 9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
| 10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 bundle.GetImageNamed(enabled_resource_id).ToImageSkia()); | 29 bundle.GetImageNamed(enabled_resource_id).ToImageSkia()); |
| 30 SetToggledImage(views::Button::STATE_NORMAL, | 30 SetToggledImage(views::Button::STATE_NORMAL, |
| 31 bundle.GetImageNamed(disabled_resource_id).ToImageSkia()); | 31 bundle.GetImageNamed(disabled_resource_id).ToImageSkia()); |
| 32 SetImage(views::Button::STATE_HOVERED, | 32 SetImage(views::Button::STATE_HOVERED, |
| 33 bundle.GetImageNamed(enabled_resource_id_hover).ToImageSkia()); | 33 bundle.GetImageNamed(enabled_resource_id_hover).ToImageSkia()); |
| 34 SetToggledImage(views::Button::STATE_HOVERED, | 34 SetToggledImage(views::Button::STATE_HOVERED, |
| 35 bundle.GetImageNamed(disabled_resource_id_hover).ToImageSkia()); | 35 bundle.GetImageNamed(disabled_resource_id_hover).ToImageSkia()); |
| 36 SetImageAlignment(views::ImageButton::ALIGN_CENTER, | 36 SetImageAlignment(views::ImageButton::ALIGN_CENTER, |
| 37 views::ImageButton::ALIGN_MIDDLE); | 37 views::ImageButton::ALIGN_MIDDLE); |
| 38 SetAccessibleName(bundle.GetLocalizedString(accessible_name_id)); | 38 SetAccessibleName(bundle.GetLocalizedString(accessible_name_id)); |
| 39 set_focusable(true); | 39 SetFocusable(true); |
| 40 set_request_focus_on_press(false); | 40 set_request_focus_on_press(false); |
| 41 | 41 |
| 42 SetFocusPainter(views::Painter::CreateSolidFocusPainter( | 42 SetFocusPainter(views::Painter::CreateSolidFocusPainter( |
| 43 kFocusBorderColor, | 43 kFocusBorderColor, |
| 44 gfx::Insets(1, 2, 2, 3))); | 44 gfx::Insets(1, 2, 2, 3))); |
| 45 } | 45 } |
| 46 | 46 |
| 47 TrayPopupHeaderButton::~TrayPopupHeaderButton() {} | 47 TrayPopupHeaderButton::~TrayPopupHeaderButton() {} |
| 48 | 48 |
| 49 const char* TrayPopupHeaderButton::GetClassName() const { | 49 const char* TrayPopupHeaderButton::GetClassName() const { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 61 canvas->FillRect(gfx::Rect(0, padding, 1, height() - padding * 2), | 61 canvas->FillRect(gfx::Rect(0, padding, 1, height() - padding * 2), |
| 62 ash::kBorderDarkColor); | 62 ash::kBorderDarkColor); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void TrayPopupHeaderButton::StateChanged() { | 65 void TrayPopupHeaderButton::StateChanged() { |
| 66 SchedulePaint(); | 66 SchedulePaint(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace internal | 69 } // namespace internal |
| 70 } // namespace ash | 70 } // namespace ash |
| OLD | NEW |