| 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 <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "chrome/browser/ui/app_list/app_list_service_impl.h" | 11 #include "chrome/browser/ui/app_list/app_list_service_impl.h" |
| 11 #include "chrome/browser/ui/app_list/app_list_shower_delegate.h" | 12 #include "chrome/browser/ui/app_list/app_list_shower_delegate.h" |
| 12 #include "chrome/browser/ui/app_list/app_list_shower_views.h" | 13 #include "chrome/browser/ui/app_list/app_list_shower_views.h" |
| 13 #include "ui/app_list/app_list_model.h" | 14 #include "ui/app_list/app_list_model.h" |
| 14 | 15 |
| 15 class AppListControllerDelegate; | 16 class AppListControllerDelegate; |
| 16 | 17 |
| 17 // AppListServiceViews manages a desktop app list that uses toolkit-views. | 18 // AppListServiceViews manages a desktop app list that uses toolkit-views. |
| 18 class AppListServiceViews : public AppListServiceImpl, | 19 class AppListServiceViews : public AppListServiceImpl, |
| 19 public AppListShowerDelegate { | 20 public AppListShowerDelegate { |
| 20 public: | 21 public: |
| 21 explicit AppListServiceViews( | 22 explicit AppListServiceViews( |
| 22 scoped_ptr<AppListControllerDelegate> controller_delegate); | 23 std::unique_ptr<AppListControllerDelegate> controller_delegate); |
| 23 ~AppListServiceViews() override; | 24 ~AppListServiceViews() override; |
| 24 | 25 |
| 25 // Set |can_dismiss| to prevent the app list dismissing when losing focus. For | 26 // Set |can_dismiss| to prevent the app list dismissing when losing focus. For |
| 26 // example, while showing a window-modal dialog. | 27 // example, while showing a window-modal dialog. |
| 27 void set_can_dismiss(bool can_dismiss) { can_dismiss_ = can_dismiss; } | 28 void set_can_dismiss(bool can_dismiss) { can_dismiss_ = can_dismiss; } |
| 28 | 29 |
| 29 AppListShower& shower() { return shower_; } | 30 AppListShower& shower() { return shower_; } |
| 30 | 31 |
| 31 // Called by the AppListControllerDelegate when it is told that the app list | 32 // Called by the AppListControllerDelegate when it is told that the app list |
| 32 // view must be destroyed. | 33 // view must be destroyed. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 56 private: | 57 private: |
| 57 // Switches to |state|, unless it is |INVALID_STATE| (in which case, opens on | 58 // Switches to |state|, unless it is |INVALID_STATE| (in which case, opens on |
| 58 // the default state). | 59 // the default state). |
| 59 void ShowForProfileInternal(Profile* profile, | 60 void ShowForProfileInternal(Profile* profile, |
| 60 app_list::AppListModel::State state); | 61 app_list::AppListModel::State state); |
| 61 | 62 |
| 62 // Responsible for creating the app list and responding to profile changes. | 63 // Responsible for creating the app list and responding to profile changes. |
| 63 AppListShower shower_; | 64 AppListShower shower_; |
| 64 | 65 |
| 65 bool can_dismiss_; | 66 bool can_dismiss_; |
| 66 scoped_ptr<AppListControllerDelegate> controller_delegate_; | 67 std::unique_ptr<AppListControllerDelegate> controller_delegate_; |
| 67 | 68 |
| 68 DISALLOW_COPY_AND_ASSIGN(AppListServiceViews); | 69 DISALLOW_COPY_AND_ASSIGN(AppListServiceViews); |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ | 72 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ |
| OLD | NEW |