Home | History | Annotate | Download | only in test
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef ASH_TEST_TEST_SHELL_DELEGATE_H_
      6 #define ASH_TEST_TEST_SHELL_DELEGATE_H_
      7 
      8 #include <string>
      9 
     10 #include "ash/shell_delegate.h"
     11 #include "base/compiler_specific.h"
     12 #include "base/memory/scoped_ptr.h"
     13 
     14 namespace keyboard {
     15 class KeyboardControllerProxy;
     16 }
     17 
     18 namespace ash {
     19 namespace test {
     20 
     21 class TestSessionStateDelegate;
     22 
     23 class TestShellDelegate : public ShellDelegate {
     24  public:
     25   TestShellDelegate();
     26   virtual ~TestShellDelegate();
     27 
     28   void set_multi_profiles_enabled(bool multi_profiles_enabled) {
     29     multi_profiles_enabled_ = multi_profiles_enabled;
     30   }
     31 
     32   // Overridden from ShellDelegate:
     33   virtual bool IsFirstRunAfterBoot() const OVERRIDE;
     34   virtual bool IsMultiProfilesEnabled() const OVERRIDE;
     35   virtual bool IsRunningInForcedAppMode() const OVERRIDE;
     36   virtual void PreInit() OVERRIDE;
     37   virtual void Shutdown() OVERRIDE;
     38   virtual void Exit() OVERRIDE;
     39   virtual void NewTab() OVERRIDE;
     40   virtual void NewWindow(bool incognito) OVERRIDE;
     41   virtual void ToggleFullscreen() OVERRIDE;
     42   virtual void ToggleMaximized() OVERRIDE;
     43   virtual void OpenFileManager(bool as_dialog) OVERRIDE;
     44   virtual void OpenCrosh() OVERRIDE;
     45   virtual void RestoreTab() OVERRIDE;
     46   virtual void ShowKeyboardOverlay() OVERRIDE;
     47   virtual keyboard::KeyboardControllerProxy*
     48       CreateKeyboardControllerProxy() OVERRIDE;
     49   virtual void ShowTaskManager() OVERRIDE;
     50   virtual content::BrowserContext* GetCurrentBrowserContext() OVERRIDE;
     51   virtual void ToggleSpokenFeedback(
     52       AccessibilityNotificationVisibility notify) OVERRIDE;
     53   virtual bool IsSpokenFeedbackEnabled() const OVERRIDE;
     54   virtual void ToggleHighContrast() OVERRIDE;
     55   virtual bool IsHighContrastEnabled() const OVERRIDE;
     56   virtual void SetMagnifierEnabled(bool enabled) OVERRIDE;
     57   virtual void SetMagnifierType(MagnifierType type) OVERRIDE;
     58   virtual bool IsMagnifierEnabled() const OVERRIDE;
     59   virtual MagnifierType GetMagnifierType() const OVERRIDE;
     60   virtual void SetLargeCursorEnabled(bool enabled) OVERRIDE;
     61   virtual bool IsLargeCursorEnabled() const OVERRIDE;
     62   virtual bool ShouldAlwaysShowAccessibilityMenu() const OVERRIDE;
     63   virtual void SilenceSpokenFeedback() const OVERRIDE;
     64   virtual app_list::AppListViewDelegate* CreateAppListViewDelegate() OVERRIDE;
     65   virtual LauncherDelegate* CreateLauncherDelegate(
     66       ash::LauncherModel* model) OVERRIDE;
     67   virtual SystemTrayDelegate* CreateSystemTrayDelegate() OVERRIDE;
     68   virtual UserWallpaperDelegate* CreateUserWallpaperDelegate() OVERRIDE;
     69   virtual CapsLockDelegate* CreateCapsLockDelegate() OVERRIDE;
     70   virtual SessionStateDelegate* CreateSessionStateDelegate() OVERRIDE;
     71   virtual aura::client::UserActionClient* CreateUserActionClient() OVERRIDE;
     72   virtual void OpenFeedbackPage() OVERRIDE;
     73   virtual void RecordUserMetricsAction(UserMetricsAction action) OVERRIDE;
     74   virtual void HandleMediaNextTrack() OVERRIDE;
     75   virtual void HandleMediaPlayPause() OVERRIDE;
     76   virtual void HandleMediaPrevTrack() OVERRIDE;
     77   virtual void SaveScreenMagnifierScale(double scale) OVERRIDE;
     78   virtual double GetSavedScreenMagnifierScale() OVERRIDE;
     79   virtual ui::MenuModel* CreateContextMenu(aura::RootWindow* root) OVERRIDE;
     80   virtual RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE;
     81   virtual base::string16 GetProductName() const OVERRIDE;
     82 
     83   int num_exit_requests() const { return num_exit_requests_; }
     84 
     85   TestSessionStateDelegate* test_session_state_delegate();
     86 
     87  private:
     88   bool spoken_feedback_enabled_;
     89   bool high_contrast_enabled_;
     90   bool screen_magnifier_enabled_;
     91   MagnifierType screen_magnifier_type_;
     92   bool large_cursor_enabled_;
     93   int num_exit_requests_;
     94   bool multi_profiles_enabled_;
     95 
     96   scoped_ptr<content::BrowserContext> current_browser_context_;
     97 
     98   TestSessionStateDelegate* test_session_state_delegate_;  // Not owned.
     99 
    100   DISALLOW_COPY_AND_ASSIGN(TestShellDelegate);
    101 };
    102 
    103 }  // namespace test
    104 }  // namespace ash
    105 
    106 #endif  // ASH_TEST_TEST_SHELL_DELEGATE_H_
    107