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.
5 #ifndef CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_
6 #define CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_
10 #include "ash/shelf/shelf_item_types.h"
11 #include "ash/shell_delegate.h"
12 #include "base/basictypes.h"
13 #include "base/compiler_specific.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "base/observer_list.h"
16 #include "content/public/browser/notification_observer.h"
17 #include "content/public/browser/notification_registrar.h"
22 class ShelfItemDelegate
;
30 class KeyboardControllerProxy
;
33 #if defined(OS_CHROMEOS)
35 class DisplayConfigurationObserver
;
39 class ChromeLauncherController
;
41 class ChromeShellDelegate
: public ash::ShellDelegate
,
42 public content::NotificationObserver
{
44 ChromeShellDelegate();
45 virtual ~ChromeShellDelegate();
47 static ChromeShellDelegate
* instance() { return instance_
; }
49 // ash::ShellDelegate overrides;
50 virtual bool IsFirstRunAfterBoot() const OVERRIDE
;
51 virtual bool IsMultiProfilesEnabled() const OVERRIDE
;
52 virtual bool IsIncognitoAllowed() const OVERRIDE
;
53 virtual bool IsRunningInForcedAppMode() const OVERRIDE
;
54 virtual bool IsMultiAccountEnabled() const OVERRIDE
;
55 virtual void PreInit() OVERRIDE
;
56 virtual void PreShutdown() OVERRIDE
;
57 virtual void Exit() OVERRIDE
;
58 virtual keyboard::KeyboardControllerProxy
*
59 CreateKeyboardControllerProxy() OVERRIDE
;
60 virtual void VirtualKeyboardActivated(bool activated
) OVERRIDE
;
61 virtual void AddVirtualKeyboardStateObserver(
62 ash::VirtualKeyboardStateObserver
* observer
) OVERRIDE
;
63 virtual void RemoveVirtualKeyboardStateObserver(
64 ash::VirtualKeyboardStateObserver
* observer
) OVERRIDE
;
65 virtual content::BrowserContext
* GetActiveBrowserContext() OVERRIDE
;
66 virtual app_list::AppListViewDelegate
* CreateAppListViewDelegate() OVERRIDE
;
67 virtual ash::ShelfDelegate
* CreateShelfDelegate(
68 ash::ShelfModel
* model
) OVERRIDE
;
69 virtual ash::SystemTrayDelegate
* CreateSystemTrayDelegate() OVERRIDE
;
70 virtual ash::UserWallpaperDelegate
* CreateUserWallpaperDelegate() OVERRIDE
;
71 virtual ash::SessionStateDelegate
* CreateSessionStateDelegate() OVERRIDE
;
72 virtual ash::AccessibilityDelegate
* CreateAccessibilityDelegate() OVERRIDE
;
73 virtual ash::NewWindowDelegate
* CreateNewWindowDelegate() OVERRIDE
;
74 virtual ash::MediaDelegate
* CreateMediaDelegate() OVERRIDE
;
75 virtual ui::MenuModel
* CreateContextMenu(
77 ash::ShelfItemDelegate
* item_delegate
,
78 ash::ShelfItem
* item
) OVERRIDE
;
79 virtual ash::GPUSupport
* CreateGPUSupport() OVERRIDE
;
80 virtual base::string16
GetProductName() const OVERRIDE
;
82 // content::NotificationObserver override:
83 virtual void Observe(int type
,
84 const content::NotificationSource
& source
,
85 const content::NotificationDetails
& details
) OVERRIDE
;
90 static ChromeShellDelegate
* instance_
;
92 content::NotificationRegistrar registrar_
;
94 ChromeLauncherController
* shelf_delegate_
;
96 ObserverList
<ash::VirtualKeyboardStateObserver
> keyboard_state_observer_list_
;
98 #if defined(OS_CHROMEOS)
99 scoped_ptr
<chromeos::DisplayConfigurationObserver
>
100 display_configuration_observer_
;
103 DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate
);
106 #endif // CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_