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 ~ChromeShellDelegate() override
;
47 static ChromeShellDelegate
* instance() { return instance_
; }
49 // ash::ShellDelegate overrides;
50 bool IsFirstRunAfterBoot() const override
;
51 bool IsMultiProfilesEnabled() const override
;
52 bool IsIncognitoAllowed() const override
;
53 bool IsRunningInForcedAppMode() const override
;
54 bool IsMultiAccountEnabled() const override
;
55 void PreInit() override
;
56 void PreShutdown() override
;
58 keyboard::KeyboardControllerProxy
* CreateKeyboardControllerProxy() override
;
59 void VirtualKeyboardActivated(bool activated
) override
;
60 void AddVirtualKeyboardStateObserver(
61 ash::VirtualKeyboardStateObserver
* observer
) override
;
62 void RemoveVirtualKeyboardStateObserver(
63 ash::VirtualKeyboardStateObserver
* observer
) override
;
64 content::BrowserContext
* GetActiveBrowserContext() override
;
65 app_list::AppListViewDelegate
* GetAppListViewDelegate() override
;
66 ash::ShelfDelegate
* CreateShelfDelegate(ash::ShelfModel
* model
) override
;
67 ash::SystemTrayDelegate
* CreateSystemTrayDelegate() override
;
68 ash::UserWallpaperDelegate
* CreateUserWallpaperDelegate() override
;
69 ash::SessionStateDelegate
* CreateSessionStateDelegate() override
;
70 ash::AccessibilityDelegate
* CreateAccessibilityDelegate() override
;
71 ash::NewWindowDelegate
* CreateNewWindowDelegate() override
;
72 ash::MediaDelegate
* CreateMediaDelegate() override
;
73 ui::MenuModel
* CreateContextMenu(aura::Window
* root
,
74 ash::ShelfItemDelegate
* item_delegate
,
75 ash::ShelfItem
* item
) override
;
76 ash::GPUSupport
* CreateGPUSupport() override
;
77 base::string16
GetProductName() const override
;
79 // content::NotificationObserver override:
80 void Observe(int type
,
81 const content::NotificationSource
& source
,
82 const content::NotificationDetails
& details
) override
;
87 static ChromeShellDelegate
* instance_
;
89 content::NotificationRegistrar registrar_
;
91 ChromeLauncherController
* shelf_delegate_
;
93 ObserverList
<ash::VirtualKeyboardStateObserver
> keyboard_state_observer_list_
;
95 #if defined(OS_CHROMEOS)
96 scoped_ptr
<chromeos::DisplayConfigurationObserver
>
97 display_configuration_observer_
;
100 DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate
);
103 #endif // CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_