Add ENABLE_MEDIA_ROUTER define to builds other than Android and iOS.
[chromium-blink-merge.git] / chrome / browser / ui / app_list / app_list_service_views.h
blob60cd10aaac95383c0a09ed8c0385ff14369abcb6
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 CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_
6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/ui/app_list/app_list_service_impl.h"
10 #include "chrome/browser/ui/app_list/app_list_shower_delegate.h"
11 #include "chrome/browser/ui/app_list/app_list_shower_views.h"
12 #include "ui/app_list/app_list_model.h"
14 class AppListControllerDelegate;
16 // AppListServiceViews manages a desktop app list that uses toolkit-views.
17 class AppListServiceViews : public AppListServiceImpl,
18 public AppListShowerDelegate {
19 public:
20 explicit AppListServiceViews(
21 scoped_ptr<AppListControllerDelegate> controller_delegate);
22 ~AppListServiceViews() override;
24 // Set |can_dismiss| to prevent the app list dismissing when losing focus. For
25 // example, while showing a window-modal dialog.
26 void set_can_dismiss(bool can_dismiss) { can_dismiss_ = can_dismiss; }
28 AppListShower& shower() { return shower_; }
30 // Called by the AppListControllerDelegate when it is told that the app list
31 // view must be destroyed.
32 virtual void OnViewBeingDestroyed();
34 // AppListService overrides:
35 void Init(Profile* initial_profile) override;
36 void ShowForProfile(Profile* requested_profile) override;
37 void ShowForAppInstall(Profile* profile,
38 const std::string& extension_id,
39 bool start_discovery_tracking) override;
40 void ShowForCustomLauncherPage(Profile* profile) override;
41 void DismissAppList() override;
42 bool IsAppListVisible() const override;
43 gfx::NativeWindow GetAppListWindow() override;
44 Profile* GetCurrentAppListProfile() override;
45 AppListControllerDelegate* GetControllerDelegate() override;
47 // AppListServiceImpl overrides:
48 void CreateForProfile(Profile* requested_profile) override;
49 void DestroyAppList() override;
51 // AppListShowerDelegate overrides:
52 AppListViewDelegate* GetViewDelegateForCreate() override;
54 private:
55 // Switches to |state|, unless it is |INVALID_STATE| (in which case, opens on
56 // the default state).
57 void ShowForProfileInternal(Profile* profile,
58 app_list::AppListModel::State state);
60 // Responsible for creating the app list and responding to profile changes.
61 AppListShower shower_;
63 bool can_dismiss_;
64 scoped_ptr<AppListControllerDelegate> controller_delegate_;
66 DISALLOW_COPY_AND_ASSIGN(AppListServiceViews);
69 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_