Files.app: Dispatch 'drive-connection-changed' event on initialization of VolumeManag...
[chromium-blink-merge.git] / extensions / browser / app_window / app_window_client.h
blobf026d809760ca1319a584e1bd4fabb56adbbbb2c
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.
5 #ifndef EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_CLIENT_H_
6 #define EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_CLIENT_H_
8 #include "base/callback_forward.h"
9 #include "extensions/browser/app_window/app_window.h"
11 namespace content {
12 class BrowserContext;
13 class WebContents;
16 namespace extensions {
18 class Extension;
19 class NativeAppWindow;
21 // Sets up global state for the app window system. Should be Set() once in each
22 // process. This should be implemented by the client of the app window system.
23 // TODO(hashimoto): Move some functions to ExtensionsClient.
24 class AppWindowClient {
25 public:
26 virtual ~AppWindowClient() {}
28 // Creates a new AppWindow for the app in |extension| for |context|.
29 // Caller takes ownership.
30 virtual AppWindow* CreateAppWindow(content::BrowserContext* context,
31 const Extension* extension) = 0;
33 // Creates a new extensions::NativeAppWindow for |window|.
34 virtual NativeAppWindow* CreateNativeAppWindow(
35 AppWindow* window,
36 AppWindow::CreateParams* params) = 0;
38 // Opens DevTools window and runs the callback.
39 virtual void OpenDevToolsWindow(content::WebContents* web_contents,
40 const base::Closure& callback) = 0;
42 // Returns true if the current channel is older than dev.
43 virtual bool IsCurrentChannelOlderThanDev() = 0;
45 // Return the app window client.
46 static AppWindowClient* Get();
48 // Initialize the app window system with this app window client.
49 static void Set(AppWindowClient* client);
52 } // namespace extensions
54 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_CLIENT_H_