Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: ui/message_center/views/message_view.cc

Issue 2918483002: Add an accessibility description for notification (Closed)
Patch Set: Fixed build failure Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "ui/message_center/views/message_view.h" 5 #include "ui/message_center/views/message_view.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/accessibility/ax_node_data.h" 8 #include "ui/accessibility/ax_node_data.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/base/models/simple_menu_model.h" 10 #include "ui/base/models/simple_menu_model.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 gfx::ShadowDetails::Get(kShadowElevation, kShadowCornerRadius); 106 gfx::ShadowDetails::Get(kShadowElevation, kShadowCornerRadius);
107 gfx::Insets ninebox_insets = gfx::ShadowValue::GetBlurRegion(shadow.values) + 107 gfx::Insets ninebox_insets = gfx::ShadowValue::GetBlurRegion(shadow.values) +
108 gfx::Insets(kShadowCornerRadius); 108 gfx::Insets(kShadowCornerRadius);
109 SetBorder(views::CreateBorderPainter( 109 SetBorder(views::CreateBorderPainter(
110 std::unique_ptr<views::Painter>(views::Painter::CreateImagePainter( 110 std::unique_ptr<views::Painter>(views::Painter::CreateImagePainter(
111 shadow.ninebox_image, ninebox_insets)), 111 shadow.ninebox_image, ninebox_insets)),
112 -gfx::ShadowValue::GetMargin(shadow.values))); 112 -gfx::ShadowValue::GetMargin(shadow.values)));
113 } 113 }
114 114
115 void MessageView::GetAccessibleNodeData(ui::AXNodeData* node_data) { 115 void MessageView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
116 node_data->role = ui::AX_ROLE_BUTTON; 116 node_data->role = ui::AX_ROLE_NOTIFICATION;
117 node_data->SetName(accessible_name_); 117 node_data->SetName(accessible_name_);
118 } 118 }
119 119
120 bool MessageView::OnMousePressed(const ui::MouseEvent& event) { 120 bool MessageView::OnMousePressed(const ui::MouseEvent& event) {
121 if (!event.IsOnlyLeftMouseButton()) 121 if (!event.IsOnlyLeftMouseButton())
122 return false; 122 return false;
123 123
124 controller_->ClickOnNotification(notification_id_); 124 controller_->ClickOnNotification(notification_id_);
125 return true; 125 return true;
126 } 126 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } 231 }
232 232
233 void MessageView::SetDrawBackgroundAsActive(bool active) { 233 void MessageView::SetDrawBackgroundAsActive(bool active) {
234 background_view_->background()-> 234 background_view_->background()->
235 SetNativeControlColor(active ? kHoveredButtonBackgroundColor : 235 SetNativeControlColor(active ? kHoveredButtonBackgroundColor :
236 kNotificationBackgroundColor); 236 kNotificationBackgroundColor);
237 SchedulePaint(); 237 SchedulePaint();
238 } 238 }
239 239
240 } // namespace message_center 240 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698