| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/night_light/night_light_toggle_button.h" | 5 #include "ash/system/night_light/night_light_toggle_button.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/strings/grit/ash_strings.h" | 8 #include "ash/strings/grit/ash_strings.h" |
| 9 #include "ash/system/night_light/night_light_controller.h" | 9 #include "ash/system/night_light/night_light_controller.h" |
| 10 #include "ash/system/tray/tray_constants.h" | 10 #include "ash/system/tray/tray_constants.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 GetNightLightNormalStateIcon(night_light_enabled)); | 54 GetNightLightNormalStateIcon(night_light_enabled)); |
| 55 SetImage(views::Button::STATE_DISABLED, | 55 SetImage(views::Button::STATE_DISABLED, |
| 56 GetNightLightDisabledStateIcon(night_light_enabled)); | 56 GetNightLightDisabledStateIcon(night_light_enabled)); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void NightLightToggleButton::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 59 void NightLightToggleButton::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 60 node_data->SetName( | 60 node_data->SetName( |
| 61 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NIGHT_LIGHT)); | 61 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NIGHT_LIGHT)); |
| 62 node_data->role = ui::AX_ROLE_TOGGLE_BUTTON; | 62 node_data->role = ui::AX_ROLE_TOGGLE_BUTTON; |
| 63 if (Shell::Get()->night_light_controller()->GetEnabled()) | 63 if (Shell::Get()->night_light_controller()->GetEnabled()) |
| 64 node_data->AddState(ui::AX_STATE_PRESSED); | 64 node_data->AddIntAttribute(ui::AX_ATTR_PRESSED_STATE, |
| 65 ui::AX_BUTTON_STATE_TRUE); |
| 65 } | 66 } |
| 66 | 67 |
| 67 } // namespace ash | 68 } // namespace ash |
| OLD | NEW |