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 3b6571411d9f20e5bd753b8cf8e0cf31133b338d..b5e6111b2423e51faf8bc328a60fcc64496a3a3e 100644 | 
| --- a/ui/app_list/views/app_list_view.h | 
| +++ b/ui/app_list/views/app_list_view.h | 
| @@ -9,12 +9,18 @@ | 
| #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/views/bubble/bubble_dialog_delegate.h" | 
| #include "ui/views/widget/widget.h" | 
| +namespace display { | 
| +class Screen; | 
| +} | 
| + | 
| namespace app_list { | 
| class ApplicationDragAndDropHost; | 
| class AppListMainView; | 
| @@ -32,7 +38,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 +69,8 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, | 
| void UpdateBounds(); | 
| + void UpdateDimensions(); | 
| 
 
msw
2017/06/06 17:56:32
nit: UpdateSize? UpdateFullscreen?
 
newcomer
2017/06/06 23:26:28
Function removed as a side effect of other changes
 
 | 
| + | 
| // 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 +98,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(); | 
| 
 
msw
2017/06/06 17:56:32
nit: combine these two to void SetFullscreen(bool
 
newcomer
2017/06/06 23:26:28
Settled offline, Introduced AppListState and Chang
 
 | 
| + void ToPeeking(); | 
| + | 
| + bool IsFullscreen() const; | 
| + | 
| private: | 
| friend class test::AppListViewTestApi; | 
| @@ -102,6 +117,20 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, | 
| // Initializes the widget as a bubble. | 
| void InitializeBubble(gfx::NativeView parent, int initial_apps_page); | 
| + // Transfers drag events to Start/Update/EndDrag. | 
| + void HandleDrag(const gfx::Point& location, ui::EventType type); | 
| + | 
| + // Initializes |initial_drag_separation_|. | 
| + void StartDrag(const gfx::Point& location); | 
| + | 
| + // Updates the bounds of the widget while maintaining the relative position | 
| + // of the top of the widget and the gesture. | 
| + void UpdateDrag(const gfx::Point& location); | 
| + | 
| + // Handles launcher state transfers. If the drag was fast enough, ignore the | 
| + // release position and snap to the next state. | 
| + void EndDrag(const gfx::Point& location); | 
| + | 
| // Overridden from views::BubbleDialogDelegateView: | 
| void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params, | 
| views::Widget* widget) const override; | 
| @@ -112,6 +141,10 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, | 
| bool WidgetHasHitTestMask() const override; | 
| void GetWidgetHitTestMask(gfx::Path* mask) const override; | 
| + // Overridden from ui::EventHandler: | 
| + 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 +153,41 @@ 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. Null if the fullscreen launcher is not | 
| 
 
msw
2017/06/06 17:56:32
nit: avoid using the term 'launcher' here and else
 
newcomer
2017/06/06 23:26:28
All of my changes that used 'launcher' have been c
 
 | 
| + // enabled. | 
| + 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 default y coordinate of the current state of the launcher. Changes | 
| + // based on the launcher state and screen orientation. | 
| 
 
msw
2017/06/06 17:56:32
Does this actually change based on the launcher st
 
newcomer
2017/06/06 23:26:28
Done.
 
 | 
| + int default_y_for_state_ = 0; | 
| + // The DIP delta that must be exceeded for the launcher to snap to the next | 
| + // state. Changes based on the launcher 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_; | 
| + | 
| + // An observer that notifies AppListView when the display has changed. | 
| + ScopedObserver<display::Screen, display::DisplayObserver> display_observer_; | 
| // A semi-transparent white overlay that covers the app list while dialogs are | 
| // open. |