Index: ash/wm/app_list_layout_delegate.h |
diff --git a/ash/wm/app_list_layout_delegate.h b/ash/wm/app_list_layout_delegate.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..985ea830a42605e2460c9ba8f2821223f2f7e485 |
--- /dev/null |
+++ b/ash/wm/app_list_layout_delegate.h |
@@ -0,0 +1,84 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef ASH_WM_APP_LIST_LAYOUT_DELEGATE_H_ |
+#define ASH_WM_APP_LIST_LAYOUT_DELEGATE_H_ |
+ |
+#include "ash/ash_export.h" |
+#include "ash/shelf/shelf_icon_observer.h" |
+#include "ash/shell_observer.h" |
+#include "base/compiler_specific.h" |
+#include "base/macros.h" |
+#include "ui/app_list/app_list_layout_delegate.h" |
+#include "ui/events/event_handler.h" |
+ |
+namespace app_list { |
+class ApplicationDragAndDropHost; |
+class AppListView; |
+} |
+ |
+namespace ui { |
+class LocatedEvent; |
+} |
+ |
+namespace ash { |
+namespace test { |
+class AppListControllerTestApi; |
+} |
+ |
+// Responsible for laying out the app list UI as well as updating the Shelf |
+// launch icon as the state of the app list changes. Listens to shell events |
+// and touches/mouse clicks outside the app list to auto dismiss the UI or |
+// update its layout as necessary. |
+class ASH_EXPORT AppListLayoutDelegate : public app_list::AppListLayoutDelegate, |
+ public ui::EventHandler, |
+ public ShellObserver, |
+ public ShelfIconObserver { |
+ public: |
+ AppListLayoutDelegate(app_list::AppListController* controller); |
+ ~AppListLayoutDelegate() override; |
+ |
+ // app_list::AppListController::LayoutDelegate: |
xiyuan
2016/03/11 18:36:00
nit: update
mfomitchev
2016/03/24 17:47:29
Done.
|
+ void Init(app_list::AppListView* view, |
+ aura::Window* root_window, |
+ int current_apps_page) override; |
+ void OnShown(aura::Window* root_window) override; |
+ void OnDismissed() override; |
+ void UpdateBounds() override; |
+ gfx::Vector2d GetVisibilityAnimationOffset( |
+ aura::Window* root_window) override; |
+ |
+ private: |
+ void ProcessLocatedEvent(ui::LocatedEvent* event); |
+ |
+ // ui::EventHandler overrides: |
+ void OnMouseEvent(ui::MouseEvent* event) override; |
+ void OnGestureEvent(ui::GestureEvent* event) override; |
+ |
+ // ShellObserver overrides: |
+ void OnShelfAlignmentChanged(aura::Window* root_window) override; |
+ void OnMaximizeModeStarted() override; |
+ void OnMaximizeModeEnded() override; |
+ |
+ // ShelfIconObserver overrides: |
+ void OnShelfIconPositionsChanged() override; |
+ |
+ // Whether the app list is visible (or in the process of being shown). |
+ bool is_visible_; |
+ |
+ // Whether the app list should remain centered. |
+ bool is_centered_; |
+ |
+ // Not owned. Pointer is guaranteed to be valid while this object is alive. |
+ app_list::AppListController* controller_; |
+ |
+ // The AppListView this class manages, owned by its widget. |
+ app_list::AppListView* view_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(AppListLayoutDelegate); |
+}; |
+ |
+} // namespace ash |
+ |
+#endif // ASH_WM_APP_LIST_LAYOUT_DELEGATE_H_ |