forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I'll incorporate changes in https://codereview.chromium.org/27238008 when it's landed. BUG=none Review URL: https://codereview.chromium.org/37663004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230619 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
oshima@chromium.org
committed
Oct 24, 2013
1 parent
c6b8bb4
commit f3ab6ef
Showing
28 changed files
with
481 additions
and
447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef ASH_ACCESSIBILITY_DELEGATE_H_ | ||
#define ASH_ACCESSIBILITY_DELEGATE_H_ | ||
|
||
#include "ash/ash_export.h" | ||
#include "ash/magnifier/magnifier_constants.h" | ||
|
||
namespace ash { | ||
|
||
enum AccessibilityNotificationVisibility { | ||
A11Y_NOTIFICATION_NONE, | ||
A11Y_NOTIFICATION_SHOW, | ||
}; | ||
|
||
// A deletate class to control accessibility features. | ||
class ASH_EXPORT AccessibilityDelegate { | ||
public: | ||
AccessibilityDelegate() {} | ||
virtual ~AccessibilityDelegate() {} | ||
|
||
// Invoked to toggle spoken feedback for accessibility | ||
virtual void ToggleSpokenFeedback( | ||
AccessibilityNotificationVisibility notify) = 0; | ||
|
||
// Returns true if spoken feedback is enabled. | ||
virtual bool IsSpokenFeedbackEnabled() const = 0; | ||
|
||
// Invoked to toggle high contrast mode for accessibility. | ||
virtual void ToggleHighContrast() = 0; | ||
|
||
// Returns true if high contrast mode is enabled. | ||
virtual bool IsHighContrastEnabled() const = 0; | ||
|
||
// Invoked to enable the screen magnifier. | ||
virtual void SetMagnifierEnabled(bool enabled) = 0; | ||
|
||
// Invoked to change the type of the screen magnifier. | ||
virtual void SetMagnifierType(MagnifierType type) = 0; | ||
|
||
// Returns true if the screen magnifier is enabled or not. | ||
virtual bool IsMagnifierEnabled() const = 0; | ||
|
||
// Returns the current screen magnifier mode. | ||
virtual MagnifierType GetMagnifierType() const = 0; | ||
|
||
// Invoked to enable Large Cursor. | ||
virtual void SetLargeCursorEnabled(bool enabled) = 0; | ||
|
||
// Returns ture if Large Cursor is enabled or not. | ||
virtual bool IsLargeCursorEnabled() const = 0; | ||
|
||
// Invoked to enable autoclick. | ||
virtual void SetAutoclickEnabled(bool enabled) = 0; | ||
|
||
// Returns if autoclick is enabled or not. | ||
virtual bool IsAutoclickEnabled() const = 0; | ||
|
||
// Returns true if the user wants to show accesibility menu even when all the | ||
// accessibility features are disabled. | ||
virtual bool ShouldAlwaysShowAccessibilityMenu() const = 0; | ||
|
||
// Cancel all current and queued speech immediately. | ||
virtual void SilenceSpokenFeedback() const = 0; | ||
|
||
// Saves the zoom scale of the full screen magnifier. | ||
virtual void SaveScreenMagnifierScale(double scale) = 0; | ||
|
||
// Gets a saved value of the zoom scale of full screen magnifier. If a value | ||
// is not saved, return a negative value. | ||
virtual double GetSavedScreenMagnifierScale() = 0; | ||
}; | ||
|
||
} // namespace ash | ||
|
||
#endif // ASH_ACCESSIBILITYDELEGATE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "ash/default_accessibility_delegate.h" | ||
|
||
#include <limits> | ||
|
||
namespace ash { | ||
namespace internal { | ||
|
||
DefaultAccessibilityDelegate::DefaultAccessibilityDelegate() | ||
: spoken_feedback_enabled_(false), | ||
high_contrast_enabled_(false), | ||
screen_magnifier_enabled_(false), | ||
screen_magnifier_type_(kDefaultMagnifierType), | ||
large_cursor_enabled_(false), | ||
autoclick_enabled_(false) { | ||
} | ||
|
||
DefaultAccessibilityDelegate::~DefaultAccessibilityDelegate() {} | ||
|
||
bool DefaultAccessibilityDelegate::IsSpokenFeedbackEnabled() const { | ||
return spoken_feedback_enabled_; | ||
} | ||
|
||
void DefaultAccessibilityDelegate::ToggleHighContrast() { | ||
high_contrast_enabled_ = !high_contrast_enabled_; | ||
} | ||
|
||
bool DefaultAccessibilityDelegate::IsHighContrastEnabled() const { | ||
return high_contrast_enabled_; | ||
} | ||
|
||
void DefaultAccessibilityDelegate::SetMagnifierEnabled(bool enabled) { | ||
screen_magnifier_enabled_ = enabled; | ||
} | ||
|
||
void DefaultAccessibilityDelegate::SetMagnifierType(MagnifierType type) { | ||
screen_magnifier_type_ = type; | ||
} | ||
|
||
bool DefaultAccessibilityDelegate::IsMagnifierEnabled() const { | ||
return screen_magnifier_enabled_; | ||
} | ||
|
||
MagnifierType DefaultAccessibilityDelegate::GetMagnifierType() const { | ||
return screen_magnifier_type_; | ||
} | ||
|
||
void DefaultAccessibilityDelegate::SetLargeCursorEnabled(bool enabled) { | ||
large_cursor_enabled_ = enabled; | ||
} | ||
|
||
bool DefaultAccessibilityDelegate::IsLargeCursorEnabled() const { | ||
return large_cursor_enabled_; | ||
} | ||
|
||
void DefaultAccessibilityDelegate::SetAutoclickEnabled(bool enabled) { | ||
autoclick_enabled_ = enabled; | ||
} | ||
|
||
bool DefaultAccessibilityDelegate::IsAutoclickEnabled() const { | ||
return autoclick_enabled_; | ||
} | ||
|
||
bool DefaultAccessibilityDelegate::ShouldAlwaysShowAccessibilityMenu() const { | ||
return false; | ||
} | ||
|
||
void DefaultAccessibilityDelegate::SilenceSpokenFeedback() const { | ||
} | ||
|
||
void DefaultAccessibilityDelegate::ToggleSpokenFeedback( | ||
AccessibilityNotificationVisibility notify) { | ||
spoken_feedback_enabled_ = !spoken_feedback_enabled_; | ||
} | ||
|
||
void DefaultAccessibilityDelegate::SaveScreenMagnifierScale(double scale) { | ||
} | ||
|
||
double DefaultAccessibilityDelegate::GetSavedScreenMagnifierScale() { | ||
return std::numeric_limits<double>::min(); | ||
} | ||
|
||
} // namespace internal | ||
} // namespace ash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef ASH_DEFAULT_ACCESSIBILITY_DELEGATE_H_ | ||
#define ASH_DEFAULT_ACCESSIBILITY_DELEGATE_H_ | ||
|
||
#include "ash/accessibility_delegate.h" | ||
#include "ash/ash_export.h" | ||
#include "base/basictypes.h" | ||
#include "base/compiler_specific.h" | ||
|
||
namespace ash { | ||
namespace internal { | ||
|
||
class ASH_EXPORT DefaultAccessibilityDelegate : public AccessibilityDelegate { | ||
public: | ||
DefaultAccessibilityDelegate(); | ||
virtual ~DefaultAccessibilityDelegate(); | ||
|
||
virtual bool IsSpokenFeedbackEnabled() const OVERRIDE; | ||
virtual void ToggleHighContrast() OVERRIDE; | ||
virtual bool IsHighContrastEnabled() const OVERRIDE; | ||
virtual void SetMagnifierEnabled(bool enabled) OVERRIDE; | ||
virtual void SetMagnifierType(MagnifierType type) OVERRIDE; | ||
virtual bool IsMagnifierEnabled() const OVERRIDE; | ||
virtual MagnifierType GetMagnifierType() const OVERRIDE; | ||
virtual void SetLargeCursorEnabled(bool enabled) OVERRIDE; | ||
virtual bool IsLargeCursorEnabled() const OVERRIDE; | ||
virtual void SetAutoclickEnabled(bool enabled) OVERRIDE; | ||
virtual bool IsAutoclickEnabled() const OVERRIDE; | ||
virtual bool ShouldAlwaysShowAccessibilityMenu() const OVERRIDE; | ||
virtual void SilenceSpokenFeedback() const OVERRIDE; | ||
virtual void ToggleSpokenFeedback( | ||
AccessibilityNotificationVisibility notify) OVERRIDE; | ||
virtual void SaveScreenMagnifierScale(double scale) OVERRIDE; | ||
virtual double GetSavedScreenMagnifierScale() OVERRIDE; | ||
|
||
private: | ||
bool spoken_feedback_enabled_; | ||
bool high_contrast_enabled_; | ||
bool screen_magnifier_enabled_; | ||
MagnifierType screen_magnifier_type_; | ||
bool large_cursor_enabled_; | ||
bool autoclick_enabled_; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(DefaultAccessibilityDelegate); | ||
}; | ||
|
||
} // namespace internal | ||
} // namespace ash | ||
|
||
#endif // DEFAULT_ACCESSIBILITY_DELEGATE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.