app_list_service_linux.h revision f2477e01787aa58f445919b809d89e252beef54f
1// Copyright 2013 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_VIEWS_APP_LIST_LINUX_APP_LIST_SERVICE_LINUX_H_
6#define CHROME_BROWSER_UI_VIEWS_APP_LIST_LINUX_APP_LIST_SERVICE_LINUX_H_
7
8#include "base/memory/scoped_ptr.h"
9#include "chrome/browser/ui/app_list/app_list_service_impl.h"
10
11template <typename T> struct DefaultSingletonTraits;
12
13class AppListShower;
14
15// AppListServiceLinux manages global resources needed for the app list to
16// operate, and controls when the app list is opened and closed.
17class AppListServiceLinux : public AppListServiceImpl {
18 public:
19  virtual ~AppListServiceLinux();
20
21  static AppListServiceLinux* GetInstance();
22  void set_can_close(bool can_close);
23  void OnAppListClosing();
24
25  // AppListService overrides:
26  virtual void Init(Profile* initial_profile) OVERRIDE;
27  virtual void CreateForProfile(Profile* requested_profile) OVERRIDE;
28  virtual void ShowForProfile(Profile* requested_profile) OVERRIDE;
29  virtual void DismissAppList() OVERRIDE;
30  virtual bool IsAppListVisible() const OVERRIDE;
31  virtual gfx::NativeWindow GetAppListWindow() OVERRIDE;
32  virtual Profile* GetCurrentAppListProfile() OVERRIDE;
33  virtual AppListControllerDelegate* GetControllerDelegate() OVERRIDE;
34
35  // AppListServiceImpl overrides:
36  virtual void CreateShortcut() OVERRIDE;
37
38 private:
39  friend struct DefaultSingletonTraits<AppListServiceLinux>;
40
41  AppListServiceLinux();
42
43  // Responsible for putting views on the screen.
44  scoped_ptr<AppListShower> shower_;
45  scoped_ptr<AppListControllerDelegate> controller_delegate_;
46
47  DISALLOW_COPY_AND_ASSIGN(AppListServiceLinux);
48};
49
50#endif  // CHROME_BROWSER_UI_VIEWS_APP_LIST_LINUX_APP_LIST_SERVICE_LINUX_H_
51