Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_WM_APP_LIST_LAYOUT_DELEGATE_H_ | |
| 6 #define ASH_WM_APP_LIST_LAYOUT_DELEGATE_H_ | |
| 7 | |
| 8 #include "ash/ash_export.h" | |
| 9 #include "ash/shelf/shelf_icon_observer.h" | |
| 10 #include "ash/shell_observer.h" | |
| 11 #include "base/compiler_specific.h" | |
| 12 #include "base/macros.h" | |
| 13 #include "ui/app_list/app_list_layout_delegate.h" | |
| 14 #include "ui/events/event_handler.h" | |
| 15 | |
| 16 namespace app_list { | |
| 17 class ApplicationDragAndDropHost; | |
| 18 class AppListView; | |
| 19 } | |
| 20 | |
| 21 namespace ui { | |
| 22 class LocatedEvent; | |
| 23 } | |
| 24 | |
| 25 namespace ash { | |
| 26 namespace test { | |
| 27 class AppListControllerTestApi; | |
| 28 } | |
| 29 | |
| 30 // 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 // and touches/mouse clicks outside the app list to auto dismiss the UI or | |
| 33 // update its layout as necessary. | |
| 34 class ASH_EXPORT AppListLayoutDelegate : public app_list::AppListLayoutDelegate, | |
| 35 public ui::EventHandler, | |
| 36 public ShellObserver, | |
| 37 public ShelfIconObserver { | |
| 38 public: | |
| 39 AppListLayoutDelegate(app_list::AppListController* controller); | |
| 40 ~AppListLayoutDelegate() override; | |
| 41 | |
| 42 // app_list::AppListController::LayoutDelegate: | |
|
xiyuan
2016/03/11 18:36:00
nit: update
mfomitchev
2016/03/24 17:47:29
Done.
| |
| 43 void Init(app_list::AppListView* view, | |
| 44 aura::Window* root_window, | |
| 45 int current_apps_page) override; | |
| 46 void OnShown(aura::Window* root_window) override; | |
| 47 void OnDismissed() override; | |
| 48 void UpdateBounds() override; | |
| 49 gfx::Vector2d GetVisibilityAnimationOffset( | |
| 50 aura::Window* root_window) override; | |
| 51 | |
| 52 private: | |
| 53 void ProcessLocatedEvent(ui::LocatedEvent* event); | |
| 54 | |
| 55 // ui::EventHandler overrides: | |
| 56 void OnMouseEvent(ui::MouseEvent* event) override; | |
| 57 void OnGestureEvent(ui::GestureEvent* event) override; | |
| 58 | |
| 59 // ShellObserver overrides: | |
| 60 void OnShelfAlignmentChanged(aura::Window* root_window) override; | |
| 61 void OnMaximizeModeStarted() override; | |
| 62 void OnMaximizeModeEnded() override; | |
| 63 | |
| 64 // ShelfIconObserver overrides: | |
| 65 void OnShelfIconPositionsChanged() override; | |
| 66 | |
| 67 // Whether the app list is visible (or in the process of being shown). | |
| 68 bool is_visible_; | |
| 69 | |
| 70 // Whether the app list should remain centered. | |
| 71 bool is_centered_; | |
| 72 | |
| 73 // Not owned. Pointer is guaranteed to be valid while this object is alive. | |
| 74 app_list::AppListController* controller_; | |
| 75 | |
| 76 // The AppListView this class manages, owned by its widget. | |
| 77 app_list::AppListView* view_; | |
| 78 | |
| 79 DISALLOW_COPY_AND_ASSIGN(AppListLayoutDelegate); | |
| 80 }; | |
| 81 | |
| 82 } // namespace ash | |
| 83 | |
| 84 #endif // ASH_WM_APP_LIST_LAYOUT_DELEGATE_H_ | |
| OLD | NEW |