Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: ui/app_list/presenter/app_list.h

Issue 2647833003: Adds AppListDelegate to AppList that is notified on visibility changes (Closed)
Patch Set: move Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/app_list/presenter/BUILD.gn ('k') | ui/app_list/presenter/app_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 UI_APP_LIST_PRESENTER_APP_LIST_H_ 5 #ifndef UI_APP_LIST_PRESENTER_APP_LIST_H_
6 #define UI_APP_LIST_PRESENTER_APP_LIST_H_ 6 #define UI_APP_LIST_PRESENTER_APP_LIST_H_
7 7
8 #include "mojo/public/cpp/bindings/binding_set.h" 8 #include "mojo/public/cpp/bindings/binding_set.h"
9 #include "ui/app_list/presenter/app_list_presenter.mojom.h" 9 #include "ui/app_list/presenter/app_list_presenter.mojom.h"
10 #include "ui/app_list/presenter/app_list_presenter_export.h" 10 #include "ui/app_list/presenter/app_list_presenter_export.h"
11 11
12 namespace app_list { 12 namespace app_list {
13 13
14 class AppListDelegate;
15
14 // Stores the app list presenter interface pointer. 16 // Stores the app list presenter interface pointer.
15 class APP_LIST_PRESENTER_EXPORT AppList : public mojom::AppList { 17 class APP_LIST_PRESENTER_EXPORT AppList : public mojom::AppList {
16 public: 18 public:
17 AppList(); 19 AppList();
18 ~AppList() override; 20 ~AppList() override;
19 21
20 // Binds the mojom::AppList interface request to this object. 22 // Binds the mojom::AppList interface request to this object.
21 void BindRequest(mojom::AppListRequest request); 23 void BindRequest(mojom::AppListRequest request);
22 24
23 // Get a raw pointer to the mojom::AppListPresenter interface; may be null. 25 // Get a raw pointer to the mojom::AppListPresenter interface; may be null.
24 mojom::AppListPresenter* GetAppListPresenter(); 26 mojom::AppListPresenter* GetAppListPresenter();
25 27
26 // Helper functions to call the underlying functionality on the presenter. 28 // Helper functions to call the underlying functionality on the presenter.
27 void Show(int64_t display_id); 29 void Show(int64_t display_id);
28 void Dismiss(); 30 void Dismiss();
29 void ToggleAppList(int64_t display_id); 31 void ToggleAppList(int64_t display_id);
30 32
31 // Helper functions to get the cached state as reported by the presenter. 33 // Helper functions to get the cached state as reported by the presenter.
32 bool IsVisible() const; 34 bool IsVisible() const;
33 bool GetTargetVisibility() const; 35 bool GetTargetVisibility() const;
34 36
35 // mojom::AppList: 37 // mojom::AppList:
36 void SetAppListPresenter(mojom::AppListPresenterPtr presenter) override; 38 void SetAppListPresenter(mojom::AppListPresenterPtr presenter) override;
37 void OnTargetVisibilityChanged(bool visible) override; 39 void OnTargetVisibilityChanged(bool visible) override;
38 void OnVisibilityChanged(bool visible) override; 40 void OnVisibilityChanged(bool visible, int64_t display_id) override;
41
42 void set_delegate(AppListDelegate* delegate) { delegate_ = delegate; }
39 43
40 private: 44 private:
41 // Bindings for the mojom::AppList interface. 45 // Bindings for the mojom::AppList interface.
42 mojo::BindingSet<mojom::AppList> bindings_; 46 mojo::BindingSet<mojom::AppList> bindings_;
43 47
44 // App list presenter interface in chrome; used to show/hide the app list. 48 // App list presenter interface in chrome; used to show/hide the app list.
45 mojom::AppListPresenterPtr presenter_; 49 mojom::AppListPresenterPtr presenter_;
46 50
47 // The cached [target] visibility, as reported by the presenter. 51 // The cached [target] visibility, as reported by the presenter.
48 bool target_visible_ = false; 52 bool target_visible_ = false;
49 bool visible_ = false; 53 bool visible_ = false;
50 54
55 AppListDelegate* delegate_ = nullptr;
56
51 DISALLOW_COPY_AND_ASSIGN(AppList); 57 DISALLOW_COPY_AND_ASSIGN(AppList);
52 }; 58 };
53 59
54 } // namespace app_list 60 } // namespace app_list
55 61
56 #endif // UI_APP_LIST_PRESENTER_APP_LIST_H_ 62 #endif // UI_APP_LIST_PRESENTER_APP_LIST_H_
OLDNEW
« no previous file with comments | « ui/app_list/presenter/BUILD.gn ('k') | ui/app_list/presenter/app_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698