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

Side by Side Diff: ash/common/system/tray_accessibility.cc

Issue 2583393002: Send notification to users upon receiving sms messages (Closed)
Patch Set: update return type Created 3 years, 10 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
« no previous file with comments | « ash/common/system/tray_accessibility.h ('k') | ash/common/system/user/tray_user_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/common/system/tray_accessibility.h" 5 #include "ash/common/system/tray_accessibility.h"
6 6
7 #include "ash/common/accessibility_delegate.h" 7 #include "ash/common/accessibility_delegate.h"
8 #include "ash/common/accessibility_types.h" 8 #include "ash/common/accessibility_types.h"
9 #include "ash/common/material_design/material_design_controller.h" 9 #include "ash/common/material_design/material_design_controller.h"
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 style->GetIconColor())); 115 style->GetIconColor()));
116 } 116 }
117 117
118 private: 118 private:
119 DISALLOW_COPY_AND_ASSIGN(DefaultAccessibilityView); 119 DISALLOW_COPY_AND_ASSIGN(DefaultAccessibilityView);
120 }; 120 };
121 121
122 //////////////////////////////////////////////////////////////////////////////// 122 ////////////////////////////////////////////////////////////////////////////////
123 // ash::tray::AccessibilityPopupView 123 // ash::tray::AccessibilityPopupView
124 124
125 AccessibilityPopupView::AccessibilityPopupView(SystemTrayItem* owner, 125 AccessibilityPopupView::AccessibilityPopupView(uint32_t enabled_state_bits)
126 uint32_t enabled_state_bits) 126 : TrayNotificationView(IDR_AURA_UBER_TRAY_ACCESSIBILITY_DARK),
127 : TrayNotificationView(owner, IDR_AURA_UBER_TRAY_ACCESSIBILITY_DARK),
128 label_(CreateLabel(enabled_state_bits)) { 127 label_(CreateLabel(enabled_state_bits)) {
129 InitView(label_); 128 InitView(label_);
130 } 129 }
131 130
132 views::Label* AccessibilityPopupView::CreateLabel(uint32_t enabled_state_bits) { 131 views::Label* AccessibilityPopupView::CreateLabel(uint32_t enabled_state_bits) {
133 DCHECK((enabled_state_bits & 132 DCHECK((enabled_state_bits &
134 (A11Y_SPOKEN_FEEDBACK | A11Y_BRAILLE_DISPLAY_CONNECTED)) != 0); 133 (A11Y_SPOKEN_FEEDBACK | A11Y_BRAILLE_DISPLAY_CONNECTED)) != 0);
135 base::string16 text; 134 base::string16 text;
136 if (enabled_state_bits & A11Y_BRAILLE_DISPLAY_CONNECTED) { 135 if (enabled_state_bits & A11Y_BRAILLE_DISPLAY_CONNECTED) {
137 text.append(l10n_util::GetStringUTF16( 136 text.append(l10n_util::GetStringUTF16(
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 430
432 return default_; 431 return default_;
433 } 432 }
434 433
435 views::View* TrayAccessibility::CreateDetailedView(LoginStatus status) { 434 views::View* TrayAccessibility::CreateDetailedView(LoginStatus status) {
436 CHECK(detailed_popup_ == NULL); 435 CHECK(detailed_popup_ == NULL);
437 CHECK(detailed_menu_ == NULL); 436 CHECK(detailed_menu_ == NULL);
438 437
439 if (request_popup_view_state_) { 438 if (request_popup_view_state_) {
440 detailed_popup_ = 439 detailed_popup_ =
441 new tray::AccessibilityPopupView(this, request_popup_view_state_); 440 new tray::AccessibilityPopupView(request_popup_view_state_);
442 request_popup_view_state_ = A11Y_NONE; 441 request_popup_view_state_ = A11Y_NONE;
443 return detailed_popup_; 442 return detailed_popup_;
444 } else { 443 } else {
445 WmShell::Get()->RecordUserMetricsAction( 444 WmShell::Get()->RecordUserMetricsAction(
446 ash::UMA_STATUS_AREA_DETAILED_ACCESSABILITY); 445 ash::UMA_STATUS_AREA_DETAILED_ACCESSABILITY);
447 detailed_menu_ = CreateDetailedMenu(); 446 detailed_menu_ = CreateDetailedMenu();
448 return detailed_menu_; 447 return detailed_menu_;
449 } 448 }
450 } 449 }
451 450
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 if (detailed_popup_) 491 if (detailed_popup_)
493 detailed_popup_->GetWidget()->Close(); 492 detailed_popup_->GetWidget()->Close();
494 if (detailed_menu_) 493 if (detailed_menu_)
495 detailed_menu_->GetWidget()->Close(); 494 detailed_menu_->GetWidget()->Close();
496 } 495 }
497 496
498 previous_accessibility_state_ = accessibility_state; 497 previous_accessibility_state_ = accessibility_state;
499 } 498 }
500 499
501 } // namespace ash 500 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray_accessibility.h ('k') | ash/common/system/user/tray_user_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698