| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 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 UI_AURA_SHELL_APP_LIST_APP_LIST_VIEW_H_ | |
| 6 #define UI_AURA_SHELL_APP_LIST_APP_LIST_VIEW_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "ui/aura_shell/app_list/app_list_item_view_listener.h" | |
| 11 #include "ui/aura_shell/aura_shell_export.h" | |
| 12 #include "ui/aura_shell/shell_delegate.h" | |
| 13 #include "ui/views/widget/widget_delegate.h" | |
| 14 | |
| 15 namespace views { | |
| 16 class View; | |
| 17 } | |
| 18 | |
| 19 namespace aura_shell { | |
| 20 | |
| 21 class AppListModel; | |
| 22 class AppListViewDelegate; | |
| 23 | |
| 24 // AppListView is the top-level view and controller of app list UI. It creates | |
| 25 // and hosts a AppListModelView and passes AppListModel to it for display. | |
| 26 class AURA_SHELL_EXPORT AppListView : public views::WidgetDelegateView, | |
| 27 public AppListItemViewListener { | |
| 28 public: | |
| 29 // Takes ownership of |model| and |delegate|. | |
| 30 AppListView(AppListModel* model, | |
| 31 AppListViewDelegate* delegate, | |
| 32 const gfx::Rect& bounds, | |
| 33 const ShellDelegate::SetWidgetCallback& callback); | |
| 34 virtual ~AppListView(); | |
| 35 | |
| 36 // Closes app list. | |
| 37 void Close(); | |
| 38 | |
| 39 private: | |
| 40 // Initializes the window. | |
| 41 void Init(const gfx::Rect& bounds, | |
| 42 const ShellDelegate::SetWidgetCallback& callback); | |
| 43 | |
| 44 // Overridden from views::View: | |
| 45 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; | |
| 46 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; | |
| 47 | |
| 48 // Overridden from AppListItemModelViewListener: | |
| 49 virtual void AppListItemActivated(AppListItemView* sender, | |
| 50 int event_flags) OVERRIDE; | |
| 51 | |
| 52 scoped_ptr<AppListModel> model_; | |
| 53 | |
| 54 scoped_ptr<AppListViewDelegate> delegate_; | |
| 55 | |
| 56 DISALLOW_COPY_AND_ASSIGN(AppListView); | |
| 57 }; | |
| 58 | |
| 59 } // namespace aura_shell | |
| 60 | |
| 61 #endif // UI_AURA_SHELL_APP_LIST_APP_LIST_VIEW_H_ | |
| OLD | NEW |