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

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

Issue 11642014: Re-introduce the partial magnifier (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix the build failure on win_aura Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « ash/shell_delegate.h ('k') | ash/test/test_shell_delegate.h » ('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/system/tray_accessibility.h" 5 #include "ash/system/tray_accessibility.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_delegate.h" 8 #include "ash/shell_delegate.h"
9 #include "ash/system/tray/system_tray.h" 9 #include "ash/system/tray/system_tray.h"
10 #include "ash/system/tray/system_tray_delegate.h" 10 #include "ash/system/tray/system_tray_delegate.h"
(...skipping 26 matching lines...) Expand all
37 A11Y_SCREEN_MAGNIFIER = 1 << 2, 37 A11Y_SCREEN_MAGNIFIER = 1 << 2,
38 }; 38 };
39 39
40 uint32 GetAccessibilityState() { 40 uint32 GetAccessibilityState() {
41 ShellDelegate* shell_delegate = Shell::GetInstance()->delegate(); 41 ShellDelegate* shell_delegate = Shell::GetInstance()->delegate();
42 uint32 state = A11Y_NONE; 42 uint32 state = A11Y_NONE;
43 if (shell_delegate->IsSpokenFeedbackEnabled()) 43 if (shell_delegate->IsSpokenFeedbackEnabled())
44 state |= A11Y_SPOKEN_FEEDBACK; 44 state |= A11Y_SPOKEN_FEEDBACK;
45 if (shell_delegate->IsHighContrastEnabled()) 45 if (shell_delegate->IsHighContrastEnabled())
46 state |= A11Y_HIGH_CONTRAST; 46 state |= A11Y_HIGH_CONTRAST;
47 if (shell_delegate->GetMagnifierType() != ash::MAGNIFIER_OFF) 47 if (shell_delegate->IsMagnifierEnabled())
48 state |= A11Y_SCREEN_MAGNIFIER; 48 state |= A11Y_SCREEN_MAGNIFIER;
49 return state; 49 return state;
50 } 50 }
51 51
52 user::LoginStatus GetCurrentLoginStatus() { 52 user::LoginStatus GetCurrentLoginStatus() {
53 return Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus(); 53 return Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus();
54 } 54 }
55 55
56 } // namespace 56 } // namespace
57 57
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 bundle.GetLocalizedString( 131 bundle.GetLocalizedString(
132 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_SPOKEN_FEEDBACK), 132 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_SPOKEN_FEEDBACK),
133 spoken_feedback_enabled_ ? gfx::Font::BOLD : gfx::Font::NORMAL, 133 spoken_feedback_enabled_ ? gfx::Font::BOLD : gfx::Font::NORMAL,
134 spoken_feedback_enabled_); 134 spoken_feedback_enabled_);
135 high_contrast_enabled_ = shell_delegate->IsHighContrastEnabled(); 135 high_contrast_enabled_ = shell_delegate->IsHighContrastEnabled();
136 high_contrast_view_ = AddScrollListItem( 136 high_contrast_view_ = AddScrollListItem(
137 bundle.GetLocalizedString( 137 bundle.GetLocalizedString(
138 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_HIGH_CONTRAST_MODE), 138 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_HIGH_CONTRAST_MODE),
139 high_contrast_enabled_ ? gfx::Font::BOLD : gfx::Font::NORMAL, 139 high_contrast_enabled_ ? gfx::Font::BOLD : gfx::Font::NORMAL,
140 high_contrast_enabled_); 140 high_contrast_enabled_);
141 screen_magnifier_enabled_ = 141 screen_magnifier_enabled_ = shell_delegate->IsMagnifierEnabled();
142 shell_delegate->GetMagnifierType() == ash::MAGNIFIER_FULL;
143 screen_magnifier_view_ = AddScrollListItem( 142 screen_magnifier_view_ = AddScrollListItem(
144 bundle.GetLocalizedString( 143 bundle.GetLocalizedString(
145 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_SCREEN_MAGNIFIER), 144 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_SCREEN_MAGNIFIER),
146 screen_magnifier_enabled_ ? gfx::Font::BOLD : gfx::Font::NORMAL, 145 screen_magnifier_enabled_ ? gfx::Font::BOLD : gfx::Font::NORMAL,
147 screen_magnifier_enabled_); 146 screen_magnifier_enabled_);
148 } 147 }
149 148
150 void AccessibilityDetailedView::AppendHelpEntries() { 149 void AccessibilityDetailedView::AppendHelpEntries() {
151 // Currently the help page requires a browser window. 150 // Currently the help page requires a browser window.
152 // TODO(yoshiki): show this even on login/lock screen. crbug.com/158286 151 // TODO(yoshiki): show this even on login/lock screen. crbug.com/158286
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 190
192 void AccessibilityDetailedView::ClickedOn(views::View* sender) { 191 void AccessibilityDetailedView::ClickedOn(views::View* sender) {
193 ShellDelegate* shell_delegate = Shell::GetInstance()->delegate(); 192 ShellDelegate* shell_delegate = Shell::GetInstance()->delegate();
194 if (sender == footer()->content()) { 193 if (sender == footer()->content()) {
195 owner()->system_tray()->ShowDefaultView(BUBBLE_USE_EXISTING); 194 owner()->system_tray()->ShowDefaultView(BUBBLE_USE_EXISTING);
196 } else if (sender == spoken_feedback_view_) { 195 } else if (sender == spoken_feedback_view_) {
197 shell_delegate->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_NONE); 196 shell_delegate->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_NONE);
198 } else if (sender == high_contrast_view_) { 197 } else if (sender == high_contrast_view_) {
199 shell_delegate->ToggleHighContrast(); 198 shell_delegate->ToggleHighContrast();
200 } else if (sender == screen_magnifier_view_) { 199 } else if (sender == screen_magnifier_view_) {
201 bool screen_magnifier_enabled = 200 shell_delegate->SetMagnifierEnabled(!shell_delegate->IsMagnifierEnabled());
202 shell_delegate->GetMagnifierType() == ash::MAGNIFIER_FULL;
203 shell_delegate->SetMagnifier(
204 screen_magnifier_enabled ? ash::MAGNIFIER_OFF : ash::MAGNIFIER_FULL);
205 } 201 }
206 } 202 }
207 203
208 void AccessibilityDetailedView::ButtonPressed(views::Button* sender, 204 void AccessibilityDetailedView::ButtonPressed(views::Button* sender,
209 const ui::Event& event) { 205 const ui::Event& event) {
210 SystemTrayDelegate* tray_delegate = 206 SystemTrayDelegate* tray_delegate =
211 Shell::GetInstance()->system_tray_delegate(); 207 Shell::GetInstance()->system_tray_delegate();
212 if (sender == help_view_) 208 if (sender == help_view_)
213 tray_delegate->ShowAccessibilityHelp(); 209 tray_delegate->ShowAccessibilityHelp();
214 } 210 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 detailed_popup_->GetWidget()->Close(); 317 detailed_popup_->GetWidget()->Close();
322 if (detailed_menu_) 318 if (detailed_menu_)
323 detailed_menu_->GetWidget()->Close(); 319 detailed_menu_->GetWidget()->Close();
324 } 320 }
325 321
326 previous_accessibility_state_ = accessibility_state; 322 previous_accessibility_state_ = accessibility_state;
327 } 323 }
328 324
329 } // namespace internal 325 } // namespace internal
330 } // namespace ash 326 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell_delegate.h ('k') | ash/test/test_shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698