Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / accessibility / accessibility_manager.h
index 82f0a5f..f805ee5 100644 (file)
 #include "base/time/time.h"
 #include "chrome/browser/chromeos/accessibility/accessibility_util.h"
 #include "chrome/browser/extensions/api/braille_display_private/braille_controller.h"
-#include "chrome/browser/extensions/extension_system.h"
 #include "content/public/browser/notification_observer.h"
 #include "content/public/browser/notification_registrar.h"
 #include "extensions/browser/event_router.h"
+#include "extensions/browser/extension_system.h"
 
+namespace content {
+class RenderViewHost;
+}
 class Profile;
 
 namespace chromeos {
@@ -42,7 +45,6 @@ struct AccessibilityStatusEventDetails {
 // watching profile notifications and pref-changes.
 // TODO(yoshiki): merge MagnificationManager with AccessibilityManager.
 class AccessibilityManager : public content::NotificationObserver,
-    public extensions::EventRouter::Observer,
     extensions::api::braille_display_private::BrailleObserver,
     public ash::SessionStateObserver {
  public:
@@ -74,6 +76,9 @@ class AccessibilityManager : public content::NotificationObserver,
   // Returns true when the accessibility menu should be shown.
   bool ShouldShowAccessibilityMenu();
 
+  // Returns true when cursor compositing should be enabled.
+  bool ShouldEnableCursorCompositing();
+
   // Enables or disables the large cursor.
   void EnableLargeCursor(bool enabled);
   // Returns true if the large cursor is enabled, or false if not.
@@ -117,6 +122,11 @@ class AccessibilityManager : public content::NotificationObserver,
   // Returns the autoclick delay in milliseconds.
   int GetAutoclickDelay() const;
 
+  // Enables or disables the virtual keyboard.
+  void EnableVirtualKeyboard(bool enabled);
+  // Returns true if the virtual keyboard is enabled, otherwise false.
+  bool IsVirtualKeyboardEnabled();
+
   // SessionStateObserver overrides:
   virtual void ActiveUserChanged(const std::string& user_id) OVERRIDE;
 
@@ -131,6 +141,9 @@ class AccessibilityManager : public content::NotificationObserver,
   // Initiates play of shutdown sound and returns it's duration.
   base::TimeDelta PlayShutdownSound();
 
+  // Injects ChromeVox scripts into given |render_view_host|.
+  void InjectChromeVox(content::RenderViewHost* render_view_host);
+
  protected:
   AccessibilityManager();
   virtual ~AccessibilityManager();
@@ -141,8 +154,8 @@ class AccessibilityManager : public content::NotificationObserver,
   void LoadChromeVoxToLockScreen();
   void UnloadChromeVox();
   void UnloadChromeVoxFromLockScreen();
-  void SetUpPreLoadChromeVox(Profile* profile);
-  void TearDownPostUnloadChromeVox(Profile* profile);
+  void PostLoadChromeVox(Profile* profile);
+  void PostUnloadChromeVox(Profile* profile);
 
   void UpdateLargeCursorFromPref();
   void UpdateStickyKeysFromPref();
@@ -150,6 +163,7 @@ class AccessibilityManager : public content::NotificationObserver,
   void UpdateHighContrastFromPref();
   void UpdateAutoclickFromPref();
   void UpdateAutoclickDelayFromPref();
+  void UpdateVirtualKeyboardFromPref();
   void LocalePrefChanged();
 
   void CheckBrailleState();
@@ -172,12 +186,6 @@ class AccessibilityManager : public content::NotificationObserver,
       const extensions::api::braille_display_private::DisplayState&
           display_state) OVERRIDE;
 
-  // EventRouter::Observer implementation.
-  virtual void OnListenerAdded(
-      const extensions::EventListenerInfo& details) OVERRIDE;
-  virtual void OnListenerRemoved(
-      const extensions::EventListenerInfo& details) OVERRIDE;
-
   // Profile which has the current a11y context.
   Profile* profile_;
 
@@ -186,9 +194,6 @@ class AccessibilityManager : public content::NotificationObserver,
   bool chrome_vox_loaded_on_lock_screen_;
   bool chrome_vox_loaded_on_user_screen_;
 
-  // Set of profiles ChromeVox is loaded to.
-  std::set<Profile*> chromevox_profiles_;
-
   content::NotificationRegistrar notification_registrar_;
   scoped_ptr<PrefChangeRegistrar> pref_change_registrar_;
   scoped_ptr<PrefChangeRegistrar> local_state_pref_change_registrar_;
@@ -199,6 +204,7 @@ class AccessibilityManager : public content::NotificationObserver,
   PrefHandler high_contrast_pref_handler_;
   PrefHandler autoclick_pref_handler_;
   PrefHandler autoclick_delay_pref_handler_;
+  PrefHandler virtual_keyboard_pref_handler_;
 
   bool large_cursor_enabled_;
   bool sticky_keys_enabled_;
@@ -206,6 +212,7 @@ class AccessibilityManager : public content::NotificationObserver,
   bool high_contrast_enabled_;
   bool autoclick_enabled_;
   int autoclick_delay_ms_;
+  bool virtual_keyboard_enabled_;
 
   ash::AccessibilityNotificationVisibility spoken_feedback_notification_;