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 CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_ 7 8 #include <string> 9 10 #include "ash/launcher/launcher_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 "content/public/browser/notification_observer.h" 16 #include "content/public/browser/notification_registrar.h" 17 18 class Browser; 19 20 namespace content { 21 class WebContents; 22 } 23 24 namespace keyboard { 25 class KeyboardControllerProxy; 26 } 27 28 class ChromeLauncherController; 29 30 class ChromeShellDelegate : public ash::ShellDelegate, 31 public content::NotificationObserver { 32 public: 33 ChromeShellDelegate(); 34 virtual ~ChromeShellDelegate(); 35 instance()36 static ChromeShellDelegate* instance() { return instance_; } 37 38 // ash::ShellDelegate overrides; 39 virtual bool IsFirstRunAfterBoot() const OVERRIDE; 40 virtual bool IsMultiProfilesEnabled() const OVERRIDE; 41 virtual bool IsIncognitoAllowed() const OVERRIDE; 42 virtual bool IsRunningInForcedAppMode() const OVERRIDE; 43 virtual void PreInit() OVERRIDE; 44 virtual void Shutdown() OVERRIDE; 45 virtual void Exit() OVERRIDE; 46 virtual keyboard::KeyboardControllerProxy* 47 CreateKeyboardControllerProxy() OVERRIDE; 48 virtual content::BrowserContext* GetActiveBrowserContext() OVERRIDE; 49 virtual app_list::AppListViewDelegate* CreateAppListViewDelegate() OVERRIDE; 50 virtual ash::ShelfDelegate* CreateShelfDelegate( 51 ash::ShelfModel* model) OVERRIDE; 52 virtual ash::SystemTrayDelegate* CreateSystemTrayDelegate() OVERRIDE; 53 virtual ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() OVERRIDE; 54 virtual ash::CapsLockDelegate* CreateCapsLockDelegate() OVERRIDE; 55 virtual ash::SessionStateDelegate* CreateSessionStateDelegate() OVERRIDE; 56 virtual ash::AccessibilityDelegate* CreateAccessibilityDelegate() OVERRIDE; 57 virtual ash::NewWindowDelegate* CreateNewWindowDelegate() OVERRIDE; 58 virtual ash::MediaDelegate* CreateMediaDelegate() OVERRIDE; 59 virtual aura::client::UserActionClient* CreateUserActionClient() OVERRIDE; 60 virtual ui::MenuModel* CreateContextMenu(aura::Window* root) OVERRIDE; 61 virtual ash::RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE; 62 virtual base::string16 GetProductName() const OVERRIDE; 63 64 // content::NotificationObserver override: 65 virtual void Observe(int type, 66 const content::NotificationSource& source, 67 const content::NotificationDetails& details) OVERRIDE; 68 69 private: 70 void PlatformInit(); 71 72 static ChromeShellDelegate* instance_; 73 74 content::NotificationRegistrar registrar_; 75 76 ChromeLauncherController* shelf_delegate_; 77 78 DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate); 79 }; 80 81 #endif // CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_ 82