Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: ui/app_list/views/contents_view.h

Issue 14533006: Drag and drop between app list and launcher - First patch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ 5 #ifndef UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_
6 #define UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ 6 #define UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "ui/views/view.h" 11 #include "ui/views/view.h"
12 12
13 namespace views { 13 namespace views {
14 class BoundsAnimator; 14 class BoundsAnimator;
15 class ViewModel; 15 class ViewModel;
16 } 16 }
17 17
18 namespace app_list { 18 namespace app_list {
19 19
20 class AppsGridView;
21 class ApplicationDnDHost;
20 class AppListMainView; 22 class AppListMainView;
21 class AppListModel; 23 class AppListModel;
22 class PaginationModel; 24 class PaginationModel;
23 25
24 // A view to manage sub views under the search box (apps grid view + page 26 // 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 27 // 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 28 // exclusive. ContentsView manages a show state to choose one set to show
27 // and animates the transition between show states. 29 // and animates the transition between show states.
28 class ContentsView : public views::View { 30 class ContentsView : public views::View {
29 public: 31 public:
30 ContentsView(AppListMainView* app_list_main_view, 32 ContentsView(AppListMainView* app_list_main_view,
31 PaginationModel* pagination_model); 33 PaginationModel* pagination_model);
32 virtual ~ContentsView(); 34 virtual ~ContentsView();
33 35
34 void SetModel(AppListModel* model); 36 void SetModel(AppListModel* model);
35 37
38 // If |dnd_host| is not NULL it will be called upon drag and drop operations
39 // outside the application list.
40 void SetAppListDnDHost(app_list::ApplicationDnDHost* dnd_host);
41
36 void ShowSearchResults(bool show); 42 void ShowSearchResults(bool show);
37 43
38 void Prerender(); 44 void Prerender();
39 45
40 private: 46 private:
41 enum ShowState { 47 enum ShowState {
42 SHOW_APPS, 48 SHOW_APPS,
43 SHOW_SEARCH_RESULTS, 49 SHOW_SEARCH_RESULTS,
44 }; 50 };
45 51
(...skipping 12 matching lines...) Expand all
58 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; 64 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
59 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; 65 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE;
60 66
61 // Overridden from ui::EventHandler: 67 // Overridden from ui::EventHandler:
62 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; 68 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
63 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; 69 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
64 70
65 ShowState show_state_; 71 ShowState show_state_;
66 PaginationModel* pagination_model_; // Owned by AppListController. 72 PaginationModel* pagination_model_; // Owned by AppListController.
67 73
74 AppsGridView* apps_grid_view_; // Owned by the view.
75
68 scoped_ptr<views::ViewModel> view_model_; 76 scoped_ptr<views::ViewModel> view_model_;
69 scoped_ptr<views::BoundsAnimator> bounds_animator_; 77 scoped_ptr<views::BoundsAnimator> bounds_animator_;
70 78
71 DISALLOW_COPY_AND_ASSIGN(ContentsView); 79 DISALLOW_COPY_AND_ASSIGN(ContentsView);
72 }; 80 };
73 81
74 } // namespace app_list 82 } // namespace app_list
75 83
76 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ 84 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698