Chromium Code Reviews| Index: ui/app_list/views/app_list_view.h |
| diff --git a/ui/app_list/views/app_list_view.h b/ui/app_list/views/app_list_view.h |
| index cbdb1d895728135ba6ba8995b4aa480b4bcfaabb..4c127ba331d8c9a1a34e098021e142c6da924f6c 100644 |
| --- a/ui/app_list/views/app_list_view.h |
| +++ b/ui/app_list/views/app_list_view.h |
| @@ -12,6 +12,7 @@ |
| #include "build/build_config.h" |
| #include "ui/app_list/app_list_export.h" |
| #include "ui/app_list/speech_ui_model_observer.h" |
| +#include "ui/display/display_observer.h" |
| #include "ui/views/bubble/bubble_dialog_delegate.h" |
| #include "ui/views/widget/widget.h" |
| @@ -32,7 +33,8 @@ class AppListViewTestApi; |
| // AppListView is the top-level view and controller of app list UI. It creates |
| // and hosts a AppsGridView and passes AppListModel to it for display. |
| class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, |
| - public SpeechUIModelObserver { |
| + public SpeechUIModelObserver, |
| + public display::DisplayObserver { |
| public: |
| // Does not take ownership of |delegate|. |
| explicit AppListView(AppListViewDelegate* delegate); |
| @@ -86,9 +88,18 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, |
| // Overridden from views::View: |
| bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| + |
| + void ComputeConstants(); |
|
vadimt
2017/05/22 23:36:58
Please don't place it between views::View override
newcomer
2017/05/25 23:10:53
Done.
|
| + |
| void Layout() override; |
| void SchedulePaintInRect(const gfx::Rect& rect) override; |
| + // Changes the view to the peeking state or to the fullscreen state. |
| + void ToFullscreen(); |
| + void ToPeeking(); |
| + |
| + bool IsFullscreen(); |
|
vadimt
2017/05/22 23:36:58
I assume there are 2 states Fullscreen and peeking
newcomer
2017/05/25 23:10:53
In the next CL there will be five states (INITIAL,
vadimt
2017/05/26 01:27:56
Acknowledged.
|
| + |
| private: |
| friend class test::AppListViewTestApi; |
| @@ -112,6 +123,17 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, |
| bool WidgetHasHitTestMask() const override; |
| void GetWidgetHitTestMask(gfx::Path* mask) const override; |
| + // Both OnMouseEvent and OnGestureEvent check to see if their events are |
| + // drag events, if so the events are sent to HandleDrag which holds all |
| + // AppListView drag logic. |
| + void OnMouseEvent(ui::MouseEvent* event) override; |
|
vadimt
2017/05/22 23:36:58
You don't need comments for overrides. BTW are the
newcomer
2017/05/25 23:10:53
They are ui::EventHandler overrides. Done!
|
| + void OnGestureEvent(ui::GestureEvent* event) override; |
| + |
| + // Handles all drag logic for the app list view. Touch and Click events are |
| + // filtered through OnMouseEvent and OnGestureEvent before being passed to |
| + // HandleDrag. |
| + void HandleDrag(gfx::Point location, ui::EventType type); |
|
vadimt
2017/05/22 23:36:58
Is this override? If so, add override keyword; els
newcomer
2017/05/25 23:10:53
Done.
|
| + |
| // Overridden from views::WidgetObserver: |
| void OnWidgetDestroying(views::Widget* widget) override; |
| void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; |
| @@ -120,14 +142,28 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, |
| void OnSpeechRecognitionStateChanged( |
| SpeechRecognitionState new_state) override; |
| + // Overridden from DisplayObserver: |
| + void OnDisplayMetricsChanged(const display::Display& display, |
| + uint32_t changed_metrics) override; |
| + |
| AppListViewDelegate* delegate_; // Weak. Owned by AppListService. |
| AppListMainView* app_list_main_view_; |
| SpeechView* speech_view_; |
| + views::Widget* fullscreen_widget_; |
| views::View* search_box_focus_host_; // Owned by the views hierarchy. |
| views::Widget* search_box_widget_; // Owned by the app list's widget. |
| SearchBoxView* search_box_view_; // Owned by |search_box_widget_|. |
| + views::View* launcher_background_shield_; // Owned by the app list's widget. |
|
vadimt
2017/05/22 23:36:58
I assume all added fields can't be made const fiel
xiyuan
2017/05/24 18:28:18
Initialize it to nullptr,
i.e.
views::View* lau
newcomer
2017/05/25 23:10:53
Correct.
newcomer
2017/05/25 23:10:53
Done.
|
| + |
| + int initial_drag_separation_; |
|
vadimt
2017/05/22 23:36:58
I know that other fields don't have comments, but
newcomer
2017/05/25 23:10:53
Done.
|
| + float last_fling_velocity_; |
| + int default_peeking_launcher_y_; |
| + int launcher_threshold_; |
| + bool is_fullscreen_launcher_; |
| + gfx::Rect display_work_area_bounds_; |
| + gfx::Rect fullscreen_widget_bounds_; |
| // A semi-transparent white overlay that covers the app list while dialogs are |
| // open. |