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..509b8d3b9b32d8b32e4dd3996eba564c428da7cd 100644 |
| --- a/ui/app_list/views/app_list_view.h |
| +++ b/ui/app_list/views/app_list_view.h |
| @@ -9,9 +9,12 @@ |
| #include "base/callback.h" |
| #include "base/macros.h" |
| +#include "base/scoped_observer.h" |
| #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/display/screen.h" |
|
xiyuan
2017/05/26 18:27:32
Can this be moved to cc?
newcomer
2017/05/26 23:20:22
Done. Forward declared Screen.
|
| #include "ui/views/bubble/bubble_dialog_delegate.h" |
| #include "ui/views/widget/widget.h" |
| @@ -32,7 +35,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); |
| @@ -62,6 +66,8 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, |
| void UpdateBounds(); |
| + void UpdateDimensions(); |
| + |
| // Enables/disables a semi-transparent overlay over the app list (good for |
| // hiding the app list when a modal dialog is being shown). |
| void SetAppListOverlayVisible(bool visible); |
| @@ -89,6 +95,12 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, |
| 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() const; |
| + |
| private: |
| friend class test::AppListViewTestApi; |
| @@ -102,6 +114,11 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, |
| // Initializes the widget as a bubble. |
| void InitializeBubble(gfx::NativeView parent, int initial_apps_page); |
| + // 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/26 17:58:55
const gfx::Point&
xiyuan
2017/05/26 18:27:32
gfx::Point -> const gfx::Point&
newcomer
2017/05/26 23:20:22
Done.
newcomer
2017/05/26 23:20:22
Done.
|
| + |
| // Overridden from views::BubbleDialogDelegateView: |
| void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params, |
| views::Widget* widget) const override; |
| @@ -112,6 +129,10 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, |
| bool WidgetHasHitTestMask() const override; |
| void GetWidgetHitTestMask(gfx::Path* mask) const override; |
| + // Overridden from ui::EventHandler |
|
xiyuan
2017/05/26 18:27:32
nit: end with ":" like other overridden comments
newcomer
2017/05/26 23:20:22
Done.
|
| + void OnMouseEvent(ui::MouseEvent* event) override; |
| + void OnGestureEvent(ui::GestureEvent* event) override; |
| + |
| // Overridden from views::WidgetObserver: |
| void OnWidgetDestroying(views::Widget* widget) override; |
| void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; |
| @@ -120,14 +141,39 @@ 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_ = nullptr; // Owned by AppListView. |
| 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_|. |
| + // Owned by the app list's widget. |
| + views::View* launcher_background_shield_ = nullptr; |
| + // The gap between the initial gesture event and the top of the window. |
| + int initial_drag_separation_ = 0; |
| + // The velocity of the gesture event. |
| + float last_fling_velocity_ = 0; |
| + // The height of the peeking launcher, which changes based on screen |
| + // orientation. |
| + int default_peeking_launcher_y_ = 0; |
| + // The DIP delta that must be exceeded for the launcher to snap to the next |
| + // state. |
| + int launcher_threshold_ = 0; |
| + bool is_fullscreen_launcher_ = false; |
| + // The desktop area, not including the shelf. |
| + gfx::Rect display_work_area_bounds_; |
| + // The bounds of the launcher. The size should never change, only the |
| + // position. |
| + gfx::Rect fullscreen_widget_bounds_; |
| + |
| + ScopedObserver<display::Screen, display::DisplayObserver> display_observer_; |
|
vadimt
2017/05/26 17:58:55
Comments for all new fields (in .h files). Everywh
newcomer
2017/05/26 23:20:22
Done.
|
| // A semi-transparent white overlay that covers the app list while dialogs are |
| // open. |