Adding instrumentation to locate the source of jankiness
[chromium-blink-merge.git] / chrome / browser / ui / ash / chrome_shell_delegate.h
bloba0989d9ed731194ece858d9a0a70c9606f70a4fb
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_
8 #include <string>
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"
19 class Browser;
21 namespace ash {
22 class ShelfItemDelegate;
25 namespace content {
26 class WebContents;
29 namespace keyboard {
30 class KeyboardControllerProxy;
33 #if defined(OS_CHROMEOS)
34 namespace chromeos {
35 class DisplayConfigurationObserver;
37 #endif
39 class ChromeLauncherController;
41 class ChromeShellDelegate : public ash::ShellDelegate,
42 public content::NotificationObserver {
43 public:
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* GetAppListViewDelegate() 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(
76 aura::Window* root,
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;
87 private:
88 void PlatformInit();
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_;
101 #endif
103 DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate);
106 #endif // CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_