OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/common/system/user/button_from_view.h" | 5 #include "ash/common/system/user/button_from_view.h" |
6 | 6 |
7 #include "ash/common/ash_constants.h" | 7 #include "ash/common/ash_constants.h" |
8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
9 #include "ash/common/system/tray/tray_constants.h" | 9 #include "ash/common/system/tray/tray_constants.h" |
10 #include "ash/common/system/tray/tray_utils.h" | 10 #include "ash/common/system/tray/tray_utils.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 GetAccessibleLabelFromDescendantViews(child_at(i), labels); | 99 GetAccessibleLabelFromDescendantViews(child_at(i), labels); |
100 node_data->SetName(base::JoinString(labels, base::ASCIIToUTF16(" "))); | 100 node_data->SetName(base::JoinString(labels, base::ASCIIToUTF16(" "))); |
101 } | 101 } |
102 | 102 |
103 void ButtonFromView::ShowActive() { | 103 void ButtonFromView::ShowActive() { |
104 if (MaterialDesignController::IsSystemTrayMenuMaterial()) | 104 if (MaterialDesignController::IsSystemTrayMenuMaterial()) |
105 return; | 105 return; |
106 bool border_visible = | 106 bool border_visible = |
107 (button_hovered_ && highlight_on_hover_) || show_border_; | 107 (button_hovered_ && highlight_on_hover_) || show_border_; |
108 SkColor border_color = border_visible ? kBorderColor : SK_ColorTRANSPARENT; | 108 SkColor border_color = border_visible ? kBorderColor : SK_ColorTRANSPARENT; |
109 SetBorder(views::Border::CreateSolidBorder(1, border_color)); | 109 SetBorder(views::CreateSolidBorder(1, border_color)); |
110 if (highlight_on_hover_) { | 110 if (highlight_on_hover_) { |
111 SkColor background_color = | 111 SkColor background_color = |
112 button_hovered_ ? kHoverBackgroundColor : kBackgroundColor; | 112 button_hovered_ ? kHoverBackgroundColor : kBackgroundColor; |
113 content_->set_background( | 113 content_->set_background( |
114 views::Background::CreateSolidBackground(background_color)); | 114 views::Background::CreateSolidBackground(background_color)); |
115 set_background(views::Background::CreateSolidBackground(background_color)); | 115 set_background(views::Background::CreateSolidBackground(background_color)); |
116 } | 116 } |
117 SchedulePaint(); | 117 SchedulePaint(); |
118 } | 118 } |
119 | 119 |
120 } // namespace tray | 120 } // namespace tray |
121 } // namespace ash | 121 } // namespace ash |
OLD | NEW |