Commit a19b3399 authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

cros: Clean up app_list_view

Moves functions to match their orderings in h and cc.
Also removes a little dead code.

Bug: 899297
Change-Id: I9c8202f5c24c811025db6dadf72edd9d2f73f4bc
Reviewed-on: https://chromium-review.googlesource.com/c/1302822Reviewed-by: default avatarWeidong Guo <weidongg@chromium.org>
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603240}
parent 64182593
This diff is collapsed.
...@@ -45,8 +45,6 @@ class TransitionAnimationObserver; ...@@ -45,8 +45,6 @@ class TransitionAnimationObserver;
// AppListView is the top-level view and controller of app list UI. It creates // 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. // and hosts a AppsGridView and passes AppListModel to it for display.
// TODO(newcomer|weidongg): Organize the cc file to match the order of
// definitions in this header.
class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView { class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView {
public: public:
class TestApi { class TestApi {
...@@ -136,14 +134,13 @@ class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView { ...@@ -136,14 +134,13 @@ class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView {
// WidgetDelegate: // WidgetDelegate:
ax::mojom::Role GetAccessibleWindowRole() const override; ax::mojom::Role GetAccessibleWindowRole() const override;
views::View* GetAppListBackgroundShieldForTest();
// ui::EventHandler: // ui::EventHandler:
void OnKeyEvent(ui::KeyEvent* event) override;
void OnScrollEvent(ui::ScrollEvent* event) override; void OnScrollEvent(ui::ScrollEvent* event) override;
void OnMouseEvent(ui::MouseEvent* event) override; void OnMouseEvent(ui::MouseEvent* event) override;
void OnGestureEvent(ui::GestureEvent* event) override; void OnGestureEvent(ui::GestureEvent* event) override;
void OnKeyEvent(ui::KeyEvent* event) override;
// Called when tablet mode starts and ends.
void OnTabletModeChanged(bool started);
// Called when the wallpaper colors change. // Called when the wallpaper colors change.
void OnWallpaperColorsChanged(); void OnWallpaperColorsChanged();
...@@ -180,13 +177,13 @@ class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView { ...@@ -180,13 +177,13 @@ class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView {
// Called when on-screen keyboard's visibility is changed. // Called when on-screen keyboard's visibility is changed.
void OnScreenKeyboardShown(bool shown); void OnScreenKeyboardShown(bool shown);
// Called when parent window's bounds is changed.
void OnParentWindowBoundsChanged();
// If the on-screen keyboard is shown, hide it. Return whether keyboard was // If the on-screen keyboard is shown, hide it. Return whether keyboard was
// hidden // hidden
bool CloseKeyboardIfVisible(); bool CloseKeyboardIfVisible();
// Called when parent window's bounds is changed.
void OnParentWindowBoundsChanged();
// Sets |is_in_drag_| and updates the visibility of app list items. // Sets |is_in_drag_| and updates the visibility of app list items.
void SetIsInDrag(bool is_in_drag); void SetIsInDrag(bool is_in_drag);
...@@ -211,6 +208,9 @@ class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView { ...@@ -211,6 +208,9 @@ class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView {
// Returns the height of app list in fullscreen state. // Returns the height of app list in fullscreen state.
int GetFullscreenStateHeight() const; int GetFullscreenStateHeight() const;
// Called when tablet mode starts and ends.
void OnTabletModeChanged(bool started);
views::Widget* get_fullscreen_widget_for_test() const { views::Widget* get_fullscreen_widget_for_test() const {
return fullscreen_widget_; return fullscreen_widget_;
} }
...@@ -248,15 +248,7 @@ class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView { ...@@ -248,15 +248,7 @@ class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView {
// Returns true if the home_launcher feature is enabled. // Returns true if the home_launcher feature is enabled.
bool is_home_launcher_enabled() const { return is_home_launcher_enabled_; } bool is_home_launcher_enabled() const { return is_home_launcher_enabled_; }
views::View* GetAppListBackgroundShieldForTest();
private: private:
// A widget observer that is responsible for keeping the AppListView state up
// to date on closing.
// TODO(newcomer): Merge this class into AppListView once the old app list
// view code is removed.
class FullscreenWidgetObserver;
void InitContents(int initial_apps_page); void InitContents(int initial_apps_page);
void InitChildWidgets(); void InitChildWidgets();
...@@ -389,10 +381,6 @@ class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView { ...@@ -389,10 +381,6 @@ class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView {
// The state of the app list, controlled via SetState(). // The state of the app list, controlled via SetState().
AppListViewState app_list_state_ = AppListViewState::PEEKING; AppListViewState app_list_state_ = AppListViewState::PEEKING;
// A widget observer that sets the AppListView state when the widget is
// closed.
std::unique_ptr<FullscreenWidgetObserver> widget_observer_;
std::unique_ptr<HideViewAnimationObserver> hide_view_animation_observer_; std::unique_ptr<HideViewAnimationObserver> hide_view_animation_observer_;
std::unique_ptr<TransitionAnimationObserver> transition_animation_observer_; std::unique_ptr<TransitionAnimationObserver> transition_animation_observer_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment