OLD | NEW |
---|---|
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_PRESENTER_IMPL_H_ | 5 #ifndef UI_APP_LIST_PRESENTER_APP_LIST_PRESENTER_IMPL_H_ |
6 #define UI_APP_LIST_PRESENTER_APP_LIST_PRESENTER_IMPL_H_ | 6 #define UI_APP_LIST_PRESENTER_APP_LIST_PRESENTER_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 // Returns app list window or NULL if it is not visible. | 47 // Returns app list window or NULL if it is not visible. |
48 aura::Window* GetWindow(); | 48 aura::Window* GetWindow(); |
49 | 49 |
50 // Returns app list view if one exists, or NULL otherwise. | 50 // Returns app list view if one exists, or NULL otherwise. |
51 AppListView* GetView() { return view_; } | 51 AppListView* GetView() { return view_; } |
52 | 52 |
53 // AppListPresenter: | 53 // AppListPresenter: |
54 void Show(int64_t display_id) override; | 54 void Show(int64_t display_id) override; |
55 void Dismiss() final; | 55 void Dismiss() final; |
56 void ToggleAppList(int64_t display_id) override; | 56 void ToggleAppList(int64_t display_id) override; |
57 bool IsVisible() const override; | 57 bool IsVisible( |
58 bool GetTargetVisibility() const override; | 58 int64_t display_id = display::kInvalidDisplayId) const override; |
59 bool GetTargetVisibility( | |
60 int64_t display_id = display::kInvalidDisplayId) const override; | |
59 | 61 |
60 private: | 62 private: |
61 friend class test::AppListPresenterImplTestApi; | 63 friend class test::AppListPresenterImplTestApi; |
62 | 64 |
63 // Sets the app list view and attempts to show it. | 65 // Sets the app list view and attempts to show it. |
64 void SetView(AppListView* view); | 66 void SetView(AppListView* view); |
65 | 67 |
66 // Forgets the view. | 68 // Forgets the view. |
67 void ResetView(); | 69 void ResetView(); |
68 | 70 |
(...skipping 20 matching lines...) Expand all Loading... | |
89 void SelectedPageChanged(int old_selected, int new_selected) override; | 91 void SelectedPageChanged(int old_selected, int new_selected) override; |
90 void TransitionStarted() override; | 92 void TransitionStarted() override; |
91 void TransitionChanged() override; | 93 void TransitionChanged() override; |
92 | 94 |
93 // Not owned | 95 // Not owned |
94 AppListPresenterDelegateFactory* const factory_; | 96 AppListPresenterDelegateFactory* const factory_; |
95 | 97 |
96 // Responsible for laying out the app list UI. | 98 // Responsible for laying out the app list UI. |
97 std::unique_ptr<AppListPresenterDelegate> presenter_delegate_; | 99 std::unique_ptr<AppListPresenterDelegate> presenter_delegate_; |
98 | 100 |
99 // Whether we should show or hide app list widget. | 101 // The id of the display on which the app list should be shown. A valid id |
100 bool is_visible_ = false; | 102 // means the target visiblity is shown, while invalid means hidden. |
James Cook
2016/11/30 23:27:20
nit: visibility
| |
103 int64_t target_display_id_ = display::kInvalidDisplayId; | |
James Cook
2016/11/30 23:27:19
optional: I'd also be OK with separate target_visi
| |
101 | 104 |
102 // The AppListView this class manages, owned by its widget. | 105 // The AppListView this class manages, owned by its widget. |
103 AppListView* view_ = nullptr; | 106 AppListView* view_ = nullptr; |
104 | 107 |
105 // The current page of the AppsGridView of |view_|. This is stored outside of | 108 // The current page of the AppsGridView of |view_|. This is stored outside of |
106 // the view's PaginationModel, so that it persists when the view is destroyed. | 109 // the view's PaginationModel, so that it persists when the view is destroyed. |
107 int current_apps_page_ = -1; | 110 int current_apps_page_ = -1; |
108 | 111 |
109 // Cached bounds of |view_| for snapping back animation after over-scroll. | 112 // Cached bounds of |view_| for snapping back animation after over-scroll. |
110 gfx::Rect view_bounds_; | 113 gfx::Rect view_bounds_; |
111 | 114 |
112 // Whether should schedule snap back animation. | 115 // Whether should schedule snap back animation. |
113 bool should_snap_back_ = false; | 116 bool should_snap_back_ = false; |
114 | 117 |
115 DISALLOW_COPY_AND_ASSIGN(AppListPresenterImpl); | 118 DISALLOW_COPY_AND_ASSIGN(AppListPresenterImpl); |
116 }; | 119 }; |
117 | 120 |
118 } // namespace app_list | 121 } // namespace app_list |
119 | 122 |
120 #endif // UI_APP_LIST_PRESENTER_APP_LIST_PRESENTER_IMPL_H_ | 123 #endif // UI_APP_LIST_PRESENTER_APP_LIST_PRESENTER_IMPL_H_ |
OLD | NEW |