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/media_delegate.h"
11#include "ash/shell_delegate.h"
12#include "base/compiler_specific.h"
13#include "base/memory/scoped_ptr.h"
14#include "base/observer_list.h"
15
16namespace keyboard {
17class KeyboardControllerProxy;
18}
19
20namespace ash {
21namespace test {
22
23class TestSessionStateDelegate;
24
25class TestShellDelegate : public ShellDelegate {
26 public:
27  TestShellDelegate();
28  virtual ~TestShellDelegate();
29
30  void set_multi_profiles_enabled(bool multi_profiles_enabled) {
31    multi_profiles_enabled_ = multi_profiles_enabled;
32  }
33
34  // Overridden from ShellDelegate:
35  virtual bool IsFirstRunAfterBoot() const OVERRIDE;
36  virtual bool IsIncognitoAllowed() const OVERRIDE;
37  virtual bool IsMultiProfilesEnabled() const OVERRIDE;
38  virtual bool IsRunningInForcedAppMode() const OVERRIDE;
39  virtual bool IsMultiAccountEnabled() const OVERRIDE;
40  virtual void PreInit() OVERRIDE;
41  virtual void PreShutdown() OVERRIDE;
42  virtual void Exit() OVERRIDE;
43  virtual keyboard::KeyboardControllerProxy*
44      CreateKeyboardControllerProxy() OVERRIDE;
45  virtual void VirtualKeyboardActivated(bool activated) OVERRIDE;
46  virtual void AddVirtualKeyboardStateObserver(
47      VirtualKeyboardStateObserver* observer) OVERRIDE;
48  virtual void RemoveVirtualKeyboardStateObserver(
49      VirtualKeyboardStateObserver* observer) OVERRIDE;
50  virtual content::BrowserContext* GetActiveBrowserContext() OVERRIDE;
51  virtual app_list::AppListViewDelegate* GetAppListViewDelegate() OVERRIDE;
52  virtual ShelfDelegate* CreateShelfDelegate(ShelfModel* model) OVERRIDE;
53  virtual SystemTrayDelegate* CreateSystemTrayDelegate() OVERRIDE;
54  virtual UserWallpaperDelegate* CreateUserWallpaperDelegate() OVERRIDE;
55  virtual SessionStateDelegate* CreateSessionStateDelegate() OVERRIDE;
56  virtual AccessibilityDelegate* CreateAccessibilityDelegate() OVERRIDE;
57  virtual NewWindowDelegate* CreateNewWindowDelegate() OVERRIDE;
58  virtual MediaDelegate* CreateMediaDelegate() OVERRIDE;
59  virtual ui::MenuModel* CreateContextMenu(
60      aura::Window* root,
61      ash::ShelfItemDelegate* item_delegate,
62      ash::ShelfItem* item) OVERRIDE;
63  virtual GPUSupport* CreateGPUSupport() OVERRIDE;
64  virtual base::string16 GetProductName() const OVERRIDE;
65
66  int num_exit_requests() const { return num_exit_requests_; }
67
68  TestSessionStateDelegate* test_session_state_delegate() {
69    return test_session_state_delegate_;
70  }
71
72  void SetMediaCaptureState(MediaCaptureState state);
73
74 private:
75  int num_exit_requests_;
76  bool multi_profiles_enabled_;
77
78  scoped_ptr<content::BrowserContext> active_browser_context_;
79  scoped_ptr<app_list::AppListViewDelegate> app_list_view_delegate_;
80
81  ObserverList<ash::VirtualKeyboardStateObserver> keyboard_state_observer_list_;
82
83  TestSessionStateDelegate* test_session_state_delegate_;  // Not owned.
84
85  DISALLOW_COPY_AND_ASSIGN(TestShellDelegate);
86};
87
88}  // namespace test
89}  // namespace ash
90
91#endif  // ASH_TEST_TEST_SHELL_DELEGATE_H_
92