OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/ui/app_list/app_list_service_impl.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" | 10 #include "chrome/browser/ui/app_list/app_list_shower_delegate.h" |
11 #include "chrome/browser/ui/app_list/app_list_shower_views.h" | 11 #include "chrome/browser/ui/app_list/app_list_shower_views.h" |
12 | 12 |
13 class AppListControllerDelegate; | 13 class AppListControllerDelegate; |
14 | 14 |
15 // AppListServiceViews manages a desktop app list that uses toolkit-views. | 15 // AppListServiceViews manages a desktop app list that uses toolkit-views. |
16 class AppListServiceViews : public AppListServiceImpl, | 16 class AppListServiceViews : public AppListServiceImpl, |
17 public AppListShowerDelegate { | 17 public AppListShowerDelegate { |
18 public: | 18 public: |
19 explicit AppListServiceViews( | 19 explicit AppListServiceViews( |
20 scoped_ptr<AppListControllerDelegate> controller_delegate); | 20 scoped_ptr<AppListControllerDelegate> controller_delegate); |
21 virtual ~AppListServiceViews(); | 21 ~AppListServiceViews() override; |
22 | 22 |
23 // Set |can_dismiss| to prevent the app list dismissing when losing focus. For | 23 // Set |can_dismiss| to prevent the app list dismissing when losing focus. For |
24 // example, while showing a window-modal dialog. | 24 // example, while showing a window-modal dialog. |
25 void set_can_dismiss(bool can_dismiss) { can_dismiss_ = can_dismiss; } | 25 void set_can_dismiss(bool can_dismiss) { can_dismiss_ = can_dismiss; } |
26 | 26 |
27 AppListShower& shower() { return shower_; } | 27 AppListShower& shower() { return shower_; } |
28 | 28 |
29 // Called by the AppListControllerDelegate when it is told that the app list | 29 // Called by the AppListControllerDelegate when it is told that the app list |
30 // view must be destroyed. | 30 // view must be destroyed. |
31 virtual void OnViewBeingDestroyed(); | 31 virtual void OnViewBeingDestroyed(); |
32 | 32 |
33 // AppListService overrides: | 33 // AppListService overrides: |
34 virtual void Init(Profile* initial_profile) override; | 34 void Init(Profile* initial_profile) override; |
35 virtual void ShowForProfile(Profile* requested_profile) override; | 35 void ShowForProfile(Profile* requested_profile) override; |
36 virtual void DismissAppList() override; | 36 void DismissAppList() override; |
37 virtual bool IsAppListVisible() const override; | 37 bool IsAppListVisible() const override; |
38 virtual gfx::NativeWindow GetAppListWindow() override; | 38 gfx::NativeWindow GetAppListWindow() override; |
39 virtual Profile* GetCurrentAppListProfile() override; | 39 Profile* GetCurrentAppListProfile() override; |
40 virtual AppListControllerDelegate* GetControllerDelegate() override; | 40 AppListControllerDelegate* GetControllerDelegate() override; |
41 | 41 |
42 // AppListServiceImpl overrides: | 42 // AppListServiceImpl overrides: |
43 virtual void CreateForProfile(Profile* requested_profile) override; | 43 void CreateForProfile(Profile* requested_profile) override; |
44 virtual void DestroyAppList() override; | 44 void DestroyAppList() override; |
45 | 45 |
46 // AppListShowerDelegate overrides: | 46 // AppListShowerDelegate overrides: |
47 virtual AppListViewDelegate* GetViewDelegateForCreate() override; | 47 AppListViewDelegate* GetViewDelegateForCreate() override; |
48 | 48 |
49 private: | 49 private: |
50 // Responsible for creating the app list and responding to profile changes. | 50 // Responsible for creating the app list and responding to profile changes. |
51 AppListShower shower_; | 51 AppListShower shower_; |
52 | 52 |
53 bool can_dismiss_; | 53 bool can_dismiss_; |
54 scoped_ptr<AppListControllerDelegate> controller_delegate_; | 54 scoped_ptr<AppListControllerDelegate> controller_delegate_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(AppListServiceViews); | 56 DISALLOW_COPY_AND_ASSIGN(AppListServiceViews); |
57 }; | 57 }; |
58 | 58 |
59 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ | 59 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ |
OLD | NEW |