OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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 #include "ash/shell/example_app_list_presenter.h" | |
6 | |
7 #include "ash/shell/example_factory.h" | |
8 #include "ui/app_list/presenter/app_list_view_delegate_factory.h" | |
9 | |
10 namespace { | |
11 | |
12 // An example app list view delegate factory. | |
13 class ExampleAppListViewDelegateFactory | |
14 : public app_list::AppListViewDelegateFactory { | |
15 public: | |
16 ExampleAppListViewDelegateFactory() {} | |
17 ~ExampleAppListViewDelegateFactory() override {} | |
18 | |
19 app_list::AppListViewDelegate* GetDelegate() override { | |
Daniel Erat
2016/12/22 18:17:57
ui/app_list/presenter/app_list_view_delegate_facto
msw
2016/12/23 03:59:34
This indeed passes a pointer to an existing (or la
| |
20 return ash::shell::CreateAppListViewDelegate(); | |
21 } | |
22 | |
23 private: | |
24 DISALLOW_COPY_AND_ASSIGN(ExampleAppListViewDelegateFactory); | |
25 }; | |
26 | |
27 } // namespace | |
28 | |
29 namespace ash { | |
30 namespace shell { | |
31 | |
32 ExampleAppListPresenter::ExampleAppListPresenter() | |
33 : binding_(this), | |
34 app_list_presenter_delegate_factory_( | |
35 base::MakeUnique<ExampleAppListViewDelegateFactory>()), | |
36 app_list_presenter_impl_(&app_list_presenter_delegate_factory_) { | |
37 // Note: This example |app_list_presenter_impl_| does not report visibility | |
38 // changes to the app_list::mojom::AppList implementation owned by WmShell. | |
39 } | |
40 | |
41 ExampleAppListPresenter::~ExampleAppListPresenter() {} | |
42 | |
43 app_list::mojom::AppListPresenterPtr | |
44 ExampleAppListPresenter::CreateInterfacePtrAndBind() { | |
45 return binding_.CreateInterfacePtrAndBind(); | |
46 } | |
47 | |
48 void ExampleAppListPresenter::Show(int64_t display_id) { | |
49 app_list_presenter_impl_.Show(display_id); | |
50 } | |
51 | |
52 void ExampleAppListPresenter::Dismiss() { | |
53 app_list_presenter_impl_.Dismiss(); | |
54 } | |
55 | |
56 void ExampleAppListPresenter::ToggleAppList(int64_t display_id) { | |
57 app_list_presenter_impl_.ToggleAppList(display_id); | |
58 } | |
59 | |
60 } // namespace shell | |
61 } // namespace ash | |
OLD | NEW |