#ifndef ASH_SYSTEM_TRAY_ACCESSIBILITY_H_
#define ASH_SYSTEM_TRAY_ACCESSIBILITY_H_
#include "ash/accessibility_delegate.h"
#include "ash/shell_observer.h"
#include "ash/system/tray/tray_details_view.h"
#include "ash/system/tray/tray_image_item.h"
#include "ash/system/tray/tray_notification_view.h"
#include "ash/system/tray/view_click_listener.h"
#include "base/gtest_prod_util.h"
#include "ui/gfx/font.h"
#include "ui/views/controls/button/button.h"
namespace chromeos {
class TrayAccessibilityTest;
}
namespace views {
class Button;
class ImageView;
class Label;
class View;
}
namespace ash {
class HoverHighlightView;
class SystemTrayItem;
class ASH_EXPORT AccessibilityObserver {
public:
virtual ~AccessibilityObserver() {}
virtual void OnAccessibilityModeChanged(
AccessibilityNotificationVisibility notify) = 0;
};
namespace tray {
class AccessibilityPopupView : public TrayNotificationView {
public:
AccessibilityPopupView(SystemTrayItem* owner, uint32 enabled_state_bits);
const views::Label* label_for_test() const { return label_; }
private:
views::Label* CreateLabel(uint32 enabled_state_bits);
views::Label* label_;
DISALLOW_COPY_AND_ASSIGN(AccessibilityPopupView);
};
class AccessibilityDetailedView : public TrayDetailsView,
public ViewClickListener,
public views::ButtonListener,
public ShellObserver {
public:
explicit AccessibilityDetailedView(SystemTrayItem* owner,
user::LoginStatus login);
virtual ~AccessibilityDetailedView() {}
private:
void AppendAccessibilityList();
void AppendHelpEntries();
HoverHighlightView* AddScrollListItem(const base::string16& text,
gfx::Font::FontStyle style,
bool checked);
virtual void OnViewClicked(views::View* sender) OVERRIDE;
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
views::View* spoken_feedback_view_;
views::View* high_contrast_view_;
views::View* screen_magnifier_view_;
views::View* large_cursor_view_;
views::View* help_view_;
views::View* settings_view_;
views::View* autoclick_view_;
views::View* virtual_keyboard_view_;
bool spoken_feedback_enabled_;
bool high_contrast_enabled_;
bool screen_magnifier_enabled_;
bool large_cursor_enabled_;
bool autoclick_enabled_;
bool virtual_keyboard_enabled_;
user::LoginStatus login_;
friend class chromeos::TrayAccessibilityTest;
DISALLOW_COPY_AND_ASSIGN(AccessibilityDetailedView);
};
}
class TrayAccessibility : public TrayImageItem,
public AccessibilityObserver {
public:
explicit TrayAccessibility(SystemTray* system_tray);
virtual ~TrayAccessibility();
private:
void SetTrayIconVisible(bool visible);
tray::AccessibilityDetailedView* CreateDetailedMenu();
virtual bool GetInitialVisibility() OVERRIDE;
virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
virtual void DestroyDefaultView() OVERRIDE;
virtual void DestroyDetailedView() OVERRIDE;
virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE;
virtual void OnAccessibilityModeChanged(
AccessibilityNotificationVisibility notify) OVERRIDE;
views::View* default_;
tray::AccessibilityPopupView* detailed_popup_;
tray::AccessibilityDetailedView* detailed_menu_;
uint32 request_popup_view_state_;
bool tray_icon_visible_;
user::LoginStatus login_;
uint32 previous_accessibility_state_;
bool show_a11y_menu_on_lock_screen_;
friend class chromeos::TrayAccessibilityTest;
DISALLOW_COPY_AND_ASSIGN(TrayAccessibility);
};
}
#endif