OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 EXTENSIONS_SHELL_BROWSER_DESKTOP_CONTROLLER_H_ |
| 6 #define EXTENSIONS_SHELL_BROWSER_DESKTOP_CONTROLLER_H_ |
| 7 |
| 8 namespace aura { |
| 9 class WindowTreeHost; |
| 10 } |
| 11 |
| 12 namespace content { |
| 13 class BrowserContext; |
| 14 } |
| 15 |
| 16 namespace extensions { |
| 17 class Extension; |
| 18 class ShellAppWindow; |
| 19 |
| 20 // DesktopController is an interface to construct the window environment in |
| 21 // extensions shell. ShellDesktopController provides a default implementation |
| 22 // for |
| 23 // app_shell, and embedder (such as athena) can provide its own. |
| 24 class DesktopController { |
| 25 public: |
| 26 DesktopController(); |
| 27 virtual ~DesktopController(); |
| 28 |
| 29 // Returns the single instance of the desktop. (Stateless functions like |
| 30 // ShellAppWindowCreateFunction need to be able to access the desktop, so |
| 31 // we need a singleton somewhere). |
| 32 static DesktopController* instance(); |
| 33 |
| 34 // Returns the WindowTreeHost created by this DesktopController. |
| 35 virtual aura::WindowTreeHost* GetHost() = 0; |
| 36 |
| 37 // Creates a new app window and adds it to the desktop. The desktop maintains |
| 38 // ownership of the window. The window must be closed before |extension| is |
| 39 // destroyed. |
| 40 virtual ShellAppWindow* CreateAppWindow(content::BrowserContext* context, |
| 41 const Extension* extension) = 0; |
| 42 |
| 43 // Closes and destroys the app windows. |
| 44 virtual void CloseAppWindows() = 0; |
| 45 }; |
| 46 |
| 47 } // namespace extensinos |
| 48 |
| 49 #endif // EXTENSIONS_SHELL_BROWSER_DESKTOP_CONTROLLER_H_ |
OLD | NEW |