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 UI_APP_LIST_CONTENTS_VIEW_H_ | |
| 6 #define UI_APP_LIST_CONTENTS_VIEW_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "ui/app_list/app_list_export.h" | |
| 11 #include "ui/views/view.h" | |
| 12 | |
| 13 namespace views { | |
| 14 class BoundsAnimator; | |
| 15 class ViewModel; | |
| 16 } | |
| 17 | |
| 18 namespace app_list { | |
| 19 | |
| 20 class AppListModel; | |
| 21 class AppListView; | |
| 22 class PaginationModel; | |
| 23 | |
| 24 // A view to manage sub views under the search box (apps grid view + page | |
| 25 // switcher and search results). The two sets of sub views are mutually | |
| 26 // exclusive. ContentsView manages a show state to choose one set to show | |
| 27 // and animates the transition between show states. | |
| 28 class APP_LIST_EXPORT ContentsView : public views::View { | |
|
tfarina
2012/06/07 22:16:19
is this going to be called outside of app_list? If
xiyuan
2012/06/07 22:24:10
Removed
| |
| 29 public: | |
| 30 ContentsView(AppListView* app_list_view, | |
| 31 PaginationModel* pagination_model); | |
| 32 virtual ~ContentsView(); | |
| 33 | |
| 34 void SetModel(AppListModel* model); | |
| 35 | |
| 36 void ShowSearchResults(bool show); | |
| 37 | |
| 38 // Overridden from views::View: | |
| 39 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
|
tfarina
2012/06/07 22:16:19
can you move these overriddes to private section?
xiyuan
2012/06/07 22:24:10
Done.
| |
| 40 virtual void Layout() OVERRIDE; | |
| 41 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; | |
| 42 | |
| 43 private: | |
| 44 enum ShowState { | |
| 45 SHOW_APPS, | |
| 46 SHOW_SEARCH_RESULTS, | |
| 47 }; | |
| 48 | |
| 49 // Sets show state. | |
| 50 void SetShowState(ShowState show_state); | |
| 51 | |
| 52 // Invoked when show state is changed. | |
| 53 void ShowStateChanged(); | |
| 54 | |
| 55 void CalculateIdealBounds(); | |
| 56 void AnimateToIdealBounds(); | |
| 57 | |
| 58 ShowState show_state_; | |
| 59 | |
| 60 scoped_ptr<views::ViewModel> view_model_; | |
| 61 scoped_ptr<views::BoundsAnimator> bounds_animator_; | |
| 62 | |
| 63 DISALLOW_COPY_AND_ASSIGN(ContentsView); | |
|
tfarina
2012/06/07 22:16:19
nit: include basictypes.h for DISALLOW and compile
xiyuan
2012/06/07 22:24:10
Done.
| |
| 64 }; | |
| 65 | |
| 66 } // namespace app_list | |
| 67 | |
| 68 #endif // UI_APP_LIST_CONTENTS_VIEW_H_ | |
| OLD | NEW |