| OLD | NEW | 
|    1 // Copyright 2016 The Chromium Authors. All rights reserved. |    1 // Copyright 2016 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 "ui/views/controls/button/toggle_button.h" |    5 #include "ui/views/controls/button/toggle_button.h" | 
|    6  |    6  | 
|    7 #include "cc/paint/paint_flags.h" |    7 #include "cc/paint/paint_flags.h" | 
|    8 #include "third_party/skia/include/core/SkDrawLooper.h" |    8 #include "third_party/skia/include/core/SkDrawLooper.h" | 
|    9 #include "ui/accessibility/ax_node_data.h" |    9 #include "ui/accessibility/ax_node_data.h" | 
|   10 #include "ui/gfx/canvas.h" |   10 #include "ui/gfx/canvas.h" | 
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  226 } |  226 } | 
|  227  |  227  | 
|  228 void ToggleButton::OnNativeThemeChanged(const ui::NativeTheme* theme) { |  228 void ToggleButton::OnNativeThemeChanged(const ui::NativeTheme* theme) { | 
|  229   SchedulePaint(); |  229   SchedulePaint(); | 
|  230 } |  230 } | 
|  231  |  231  | 
|  232 void ToggleButton::GetAccessibleNodeData(ui::AXNodeData* node_data) { |  232 void ToggleButton::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 
|  233   CustomButton::GetAccessibleNodeData(node_data); |  233   CustomButton::GetAccessibleNodeData(node_data); | 
|  234  |  234  | 
|  235   node_data->role = ui::AX_ROLE_SWITCH; |  235   node_data->role = ui::AX_ROLE_SWITCH; | 
|  236   const ui::AXCheckedState checked_state = |  236   const ui::AXButtonState checked_state = | 
|  237       is_on_ ? ui::AX_CHECKED_STATE_TRUE : ui::AX_CHECKED_STATE_FALSE; |  237       is_on_ ? ui::AX_BUTTON_STATE_TRUE : ui::AX_BUTTON_STATE_FALSE; | 
|  238   node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, checked_state); |  238   node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, checked_state); | 
|  239 } |  239 } | 
|  240  |  240  | 
|  241 void ToggleButton::NotifyClick(const ui::Event& event) { |  241 void ToggleButton::NotifyClick(const ui::Event& event) { | 
|  242   SetIsOn(!is_on(), true); |  242   SetIsOn(!is_on(), true); | 
|  243   CustomButton::NotifyClick(event); |  243   CustomButton::NotifyClick(event); | 
|  244 } |  244 } | 
|  245  |  245  | 
|  246 void ToggleButton::AddInkDropLayer(ui::Layer* ink_drop_layer) { |  246 void ToggleButton::AddInkDropLayer(ui::Layer* ink_drop_layer) { | 
|  247   thumb_view_->AddInkDropLayer(ink_drop_layer); |  247   thumb_view_->AddInkDropLayer(ink_drop_layer); | 
| (...skipping 25 matching lines...) Expand all  Loading... | 
|  273     // TODO(varkha, estade): The thumb is using its own view. Investigate if |  273     // TODO(varkha, estade): The thumb is using its own view. Investigate if | 
|  274     // repainting in every animation step to update colors could be avoided. |  274     // repainting in every animation step to update colors could be avoided. | 
|  275     UpdateThumb(); |  275     UpdateThumb(); | 
|  276     SchedulePaint(); |  276     SchedulePaint(); | 
|  277     return; |  277     return; | 
|  278   } |  278   } | 
|  279   CustomButton::AnimationProgressed(animation); |  279   CustomButton::AnimationProgressed(animation); | 
|  280 } |  280 } | 
|  281  |  281  | 
|  282 }  // namespace views |  282 }  // namespace views | 
| OLD | NEW |