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 "chrome/browser/ui/ash/metrics/chrome_user_metrics_recorder.h"
17 #include "content/public/browser/notification_observer.h"
18 #include "content/public/browser/notification_registrar.h"
23 class ShelfItemDelegate
;
31 class KeyboardControllerProxy
;
34 #if defined(OS_CHROMEOS)
36 class DisplayConfigurationObserver
;
40 class ChromeLauncherController
;
42 class ChromeShellDelegate
: public ash::ShellDelegate
,
43 public content::NotificationObserver
{
45 ChromeShellDelegate();
46 ~ChromeShellDelegate() override
;
48 static ChromeShellDelegate
* instance() { return instance_
; }
50 // ash::ShellDelegate overrides;
51 bool IsFirstRunAfterBoot() const override
;
52 bool IsMultiProfilesEnabled() const override
;
53 bool IsIncognitoAllowed() const override
;
54 bool IsRunningInForcedAppMode() const override
;
55 bool IsMultiAccountEnabled() const override
;
56 bool IsForceMaximizeOnFirstRun() const override
;
57 void PreInit() override
;
58 void PreShutdown() override
;
60 keyboard::KeyboardControllerProxy
* CreateKeyboardControllerProxy() override
;
61 void VirtualKeyboardActivated(bool activated
) override
;
62 void AddVirtualKeyboardStateObserver(
63 ash::VirtualKeyboardStateObserver
* observer
) override
;
64 void RemoveVirtualKeyboardStateObserver(
65 ash::VirtualKeyboardStateObserver
* observer
) override
;
66 content::BrowserContext
* GetActiveBrowserContext() override
;
67 app_list::AppListViewDelegate
* GetAppListViewDelegate() override
;
68 ash::ShelfDelegate
* CreateShelfDelegate(ash::ShelfModel
* model
) override
;
69 ash::SystemTrayDelegate
* CreateSystemTrayDelegate() override
;
70 ash::UserWallpaperDelegate
* CreateUserWallpaperDelegate() override
;
71 ash::SessionStateDelegate
* CreateSessionStateDelegate() override
;
72 ash::AccessibilityDelegate
* CreateAccessibilityDelegate() override
;
73 ash::NewWindowDelegate
* CreateNewWindowDelegate() override
;
74 ash::MediaDelegate
* CreateMediaDelegate() override
;
75 ui::MenuModel
* CreateContextMenu(aura::Window
* root
,
76 ash::ShelfItemDelegate
* item_delegate
,
77 ash::ShelfItem
* item
) override
;
78 ash::GPUSupport
* CreateGPUSupport() override
;
79 base::string16
GetProductName() const override
;
81 // content::NotificationObserver override:
82 void Observe(int type
,
83 const content::NotificationSource
& source
,
84 const content::NotificationDetails
& details
) override
;
89 static ChromeShellDelegate
* instance_
;
91 content::NotificationRegistrar registrar_
;
93 ChromeLauncherController
* shelf_delegate_
;
95 base::ObserverList
<ash::VirtualKeyboardStateObserver
>
96 keyboard_state_observer_list_
;
98 // Proxies events from chrome/browser to ash::UserMetricsRecorder.
99 scoped_ptr
<ChromeUserMetricsRecorder
> chrome_user_metrics_recorder_
;
101 #if defined(OS_CHROMEOS)
102 scoped_ptr
<chromeos::DisplayConfigurationObserver
>
103 display_configuration_observer_
;
106 DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate
);
109 #endif // CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_