OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_H_ | 5 #ifndef ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_H_ |
6 #define ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_H_ | 6 #define ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
11 #include "ash/shelf/shelf_observer.h" | |
11 #include "ash/shell_observer.h" | 12 #include "ash/shell_observer.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "ui/app_list/presenter/app_list_presenter_delegate.h" | 14 #include "ui/app_list/presenter/app_list_presenter_delegate.h" |
14 #include "ui/events/event_handler.h" | 15 #include "ui/events/event_handler.h" |
15 #include "ui/keyboard/keyboard_controller_observer.h" | 16 #include "ui/keyboard/keyboard_controller_observer.h" |
16 | 17 |
17 namespace app_list { | 18 namespace app_list { |
18 class AppListPresenterImpl; | 19 class AppListPresenterImpl; |
19 class AppListView; | 20 class AppListView; |
20 class AppListViewDelegateFactory; | 21 class AppListViewDelegateFactory; |
21 } | 22 } |
22 | 23 |
23 namespace ui { | 24 namespace ui { |
24 class LocatedEvent; | 25 class LocatedEvent; |
25 } | 26 } |
26 | 27 |
27 namespace ash { | 28 namespace ash { |
28 | 29 |
29 // Non-Mus+ash implementation of AppListPresenterDelegate. | 30 // Non-Mus+ash implementation of AppListPresenterDelegate. |
30 // Responsible for laying out the app list UI as well as updating the Shelf | 31 // Responsible for laying out the app list UI as well as updating the Shelf |
31 // launch icon as the state of the app list changes. Listens to shell events | 32 // launch icon as the state of the app list changes. Listens to shell events |
32 // and touches/mouse clicks outside the app list to auto dismiss the UI or | 33 // and touches/mouse clicks outside the app list to auto dismiss the UI or |
33 // update its layout as necessary. | 34 // update its layout as necessary. |
34 class ASH_EXPORT AppListPresenterDelegate | 35 class ASH_EXPORT AppListPresenterDelegate |
35 : public app_list::AppListPresenterDelegate, | 36 : public app_list::AppListPresenterDelegate, |
36 public ui::EventHandler, | 37 public ui::EventHandler, |
37 public keyboard::KeyboardControllerObserver, | 38 public keyboard::KeyboardControllerObserver, |
38 public ShellObserver { | 39 public ShellObserver, |
40 public ShelfObserver { | |
xiyuan
2017/06/13 21:38:58
Is ShelfObserver used?
newcomer
2017/06/13 22:22:47
no, thanks!
| |
39 public: | 41 public: |
40 AppListPresenterDelegate( | 42 AppListPresenterDelegate( |
41 app_list::AppListPresenterImpl* presenter, | 43 app_list::AppListPresenterImpl* presenter, |
42 app_list::AppListViewDelegateFactory* view_delegate_factory); | 44 app_list::AppListViewDelegateFactory* view_delegate_factory); |
43 ~AppListPresenterDelegate() override; | 45 ~AppListPresenterDelegate() override; |
44 | 46 |
45 // app_list::AppListPresenterDelegate: | 47 // app_list::AppListPresenterDelegate: |
46 app_list::AppListViewDelegate* GetViewDelegate() override; | 48 app_list::AppListViewDelegate* GetViewDelegate() override; |
47 void Init(app_list::AppListView* view, | 49 void Init(app_list::AppListView* view, |
48 int64_t display_id, | 50 int64_t display_id, |
49 int current_apps_page) override; | 51 int current_apps_page) override; |
50 void OnShown(int64_t display_id) override; | 52 void OnShown(int64_t display_id) override; |
51 void OnDismissed() override; | 53 void OnDismissed() override; |
52 void UpdateBounds() override; | 54 void UpdateBounds() override; |
53 gfx::Vector2d GetVisibilityAnimationOffset( | 55 gfx::Vector2d GetVisibilityAnimationOffset( |
54 aura::Window* root_window) override; | 56 aura::Window* root_window) override; |
57 // Whether the maximize mode controller is active. | |
58 bool IsMaximizeModeActive() const; | |
xiyuan
2017/06/13 21:38:58
This and IsSideShelf() can go into cc file in anon
newcomer
2017/06/13 22:22:47
Done.
| |
59 // Whether the shelf is oriented on the side, not on the bottom. | |
60 bool IsSideShelf() const; | |
55 | 61 |
56 private: | 62 private: |
57 void ProcessLocatedEvent(ui::LocatedEvent* event); | 63 void ProcessLocatedEvent(ui::LocatedEvent* event); |
58 | 64 |
59 // ui::EventHandler overrides: | 65 // ui::EventHandler overrides: |
60 void OnMouseEvent(ui::MouseEvent* event) override; | 66 void OnMouseEvent(ui::MouseEvent* event) override; |
61 void OnGestureEvent(ui::GestureEvent* event) override; | 67 void OnGestureEvent(ui::GestureEvent* event) override; |
62 | 68 |
63 // KeyboardControllerObserver overrides: | 69 // KeyboardControllerObserver overrides: |
64 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; | 70 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; |
65 void OnKeyboardClosed() override; | 71 void OnKeyboardClosed() override; |
66 | 72 |
73 // ShelfObserver overrides: | |
74 void OnShelfIconPositionChanged(); | |
oshima
2017/06/13 22:26:04
override?
newcomer
2017/06/13 23:00:39
Function removed as a side effect of xiyuan@'s com
| |
75 | |
67 // ShellObserver overrides: | 76 // ShellObserver overrides: |
68 void OnOverviewModeStarting() override; | 77 void OnOverviewModeStarting() override; |
78 void OnMaximizeModeStarted() override; | |
79 void OnMaximizeModeEnded() override; | |
69 | 80 |
70 // Whether the app list is visible (or in the process of being shown). | 81 // Whether the app list is visible (or in the process of being shown). |
71 bool is_visible_ = false; | 82 bool is_visible_ = false; |
72 | 83 |
73 // Not owned. Pointer is guaranteed to be valid while this object is alive. | 84 // Not owned. Pointer is guaranteed to be valid while this object is alive. |
74 app_list::AppListPresenterImpl* presenter_; | 85 app_list::AppListPresenterImpl* presenter_; |
75 | 86 |
76 // Not owned. Pointer is guaranteed to be valid while this object is alive. | 87 // Not owned. Pointer is guaranteed to be valid while this object is alive. |
77 app_list::AppListViewDelegateFactory* view_delegate_factory_; | 88 app_list::AppListViewDelegateFactory* view_delegate_factory_; |
78 | 89 |
79 // Owned by its widget. | 90 // Owned by its widget. |
80 app_list::AppListView* view_ = nullptr; | 91 app_list::AppListView* view_ = nullptr; |
81 | 92 |
82 DISALLOW_COPY_AND_ASSIGN(AppListPresenterDelegate); | 93 DISALLOW_COPY_AND_ASSIGN(AppListPresenterDelegate); |
83 }; | 94 }; |
84 | 95 |
85 } // namespace ash | 96 } // namespace ash |
86 | 97 |
87 #endif // ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_H_ | 98 #endif // ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_H_ |
OLD | NEW |