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 #include "ui/app_list/app_list_model.h" | 12 #include "ui/app_list/app_list_model.h" |
13 | 13 |
14 class AppListControllerDelegate; | 14 class AppListControllerDelegate; |
15 | 15 |
16 // AppListServiceViews manages a desktop app list that uses toolkit-views. | 16 // AppListServiceViews manages a desktop app list that uses toolkit-views. |
17 class AppListServiceViews : public AppListServiceImpl, | 17 class AppListServiceViews : public AppListServiceImpl, |
18 public AppListShowerDelegate { | 18 public AppListShowerDelegate { |
19 public: | 19 public: |
20 explicit AppListServiceViews( | 20 explicit AppListServiceViews( |
21 scoped_ptr<AppListControllerDelegate> controller_delegate); | 21 scoped_ptr<AppListControllerDelegate> controller_delegate); |
22 ~AppListServiceViews() override; | 22 ~AppListServiceViews() override; |
23 | 23 |
24 // Set |can_dismiss| to prevent the app list dismissing when losing focus. For | 24 // Set |can_dismiss| to prevent the app list dismissing when losing focus. For |
25 // example, while showing a window-modal dialog. | 25 // example, while showing a window-modal dialog. |
26 void set_can_dismiss(bool can_dismiss) { can_dismiss_ = can_dismiss; } | 26 void set_can_dismiss(bool can_dismiss) { can_dismiss_ = can_dismiss; } |
27 | 27 |
28 AppListShower& shower() { return shower_; } | 28 AppListShower& shower() { return shower_; } |
| 29 const AppListShower& shower() const { return shower_; } |
29 | 30 |
30 // Called by the AppListControllerDelegate when it is told that the app list | 31 // Called by the AppListControllerDelegate when it is told that the app list |
31 // view must be destroyed. | 32 // view must be destroyed. |
32 virtual void OnViewBeingDestroyed(); | 33 virtual void OnViewBeingDestroyed(); |
33 | 34 |
34 // AppListService overrides: | 35 // AppListService overrides: |
35 void Init(Profile* initial_profile) override; | 36 void Init(Profile* initial_profile) override; |
36 void ShowForProfile(Profile* requested_profile) override; | 37 void ShowForProfile(Profile* requested_profile) override; |
37 void ShowForAppInstall(Profile* profile, | 38 void ShowForAppInstall(Profile* profile, |
38 const std::string& extension_id, | 39 const std::string& extension_id, |
(...skipping 21 matching lines...) Expand all Loading... |
60 // Responsible for creating the app list and responding to profile changes. | 61 // Responsible for creating the app list and responding to profile changes. |
61 AppListShower shower_; | 62 AppListShower shower_; |
62 | 63 |
63 bool can_dismiss_; | 64 bool can_dismiss_; |
64 scoped_ptr<AppListControllerDelegate> controller_delegate_; | 65 scoped_ptr<AppListControllerDelegate> controller_delegate_; |
65 | 66 |
66 DISALLOW_COPY_AND_ASSIGN(AppListServiceViews); | 67 DISALLOW_COPY_AND_ASSIGN(AppListServiceViews); |
67 }; | 68 }; |
68 | 69 |
69 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ | 70 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ |
OLD | NEW |