OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "ui/app_list/views/app_list_main_view.h" | 5 #include "ui/app_list/views/app_list_main_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 namespace app_list { | 30 namespace app_list { |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
34 // Inner padding space in pixels of bubble contents. | 34 // Inner padding space in pixels of bubble contents. |
35 const int kInnerPadding = 1; | 35 const int kInnerPadding = 1; |
36 | 36 |
37 // The maximum allowed time to wait for icon loading in milliseconds. | 37 // The maximum allowed time to wait for icon loading in milliseconds. |
38 const int kMaxIconLoadingWaitTimeInMs = 50; | 38 const int kMaxIconLoadingWaitTimeInMs = 50; |
39 | 39 |
| 40 const int kContentsViewIndex = 1; |
| 41 |
40 } // namespace | 42 } // namespace |
41 | 43 |
42 //////////////////////////////////////////////////////////////////////////////// | 44 //////////////////////////////////////////////////////////////////////////////// |
43 // AppListMainView::IconLoader | 45 // AppListMainView::IconLoader |
44 | 46 |
45 class AppListMainView::IconLoader : public AppListItemObserver { | 47 class AppListMainView::IconLoader : public AppListItemObserver { |
46 public: | 48 public: |
47 IconLoader(AppListMainView* owner, | 49 IconLoader(AppListMainView* owner, |
48 AppListItem* item, | 50 AppListItem* item, |
49 float scale) | 51 float scale) |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 search_box_view_ = new SearchBoxView(this, delegate); | 101 search_box_view_ = new SearchBoxView(this, delegate); |
100 AddChildView(search_box_view_); | 102 AddChildView(search_box_view_); |
101 AddContentsView(); | 103 AddContentsView(); |
102 if (app_list::switches::IsExperimentalAppListEnabled()) | 104 if (app_list::switches::IsExperimentalAppListEnabled()) |
103 AddChildView(new ContentsSwitcherView(contents_view_)); | 105 AddChildView(new ContentsSwitcherView(contents_view_)); |
104 } | 106 } |
105 | 107 |
106 void AppListMainView::AddContentsView() { | 108 void AppListMainView::AddContentsView() { |
107 contents_view_ = new ContentsView( | 109 contents_view_ = new ContentsView( |
108 this, pagination_model_, model_, delegate_); | 110 this, pagination_model_, model_, delegate_); |
109 AddChildView(contents_view_); | 111 AddChildViewAt(contents_view_, kContentsViewIndex); |
110 | 112 |
111 search_box_view_->set_contents_view(contents_view_); | 113 search_box_view_->set_contents_view(contents_view_); |
112 | 114 |
113 #if defined(USE_AURA) | 115 #if defined(USE_AURA) |
114 contents_view_->SetPaintToLayer(true); | 116 contents_view_->SetPaintToLayer(true); |
115 contents_view_->SetFillsBoundsOpaquely(false); | 117 contents_view_->SetFillsBoundsOpaquely(false); |
116 contents_view_->layer()->SetMasksToBounds(true); | 118 contents_view_->layer()->SetMasksToBounds(true); |
117 #endif | 119 #endif |
118 } | 120 } |
119 | 121 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // Resubmit the query via a posted task so that all observers for the | 271 // Resubmit the query via a posted task so that all observers for the |
270 // uninstall notification are notified. | 272 // uninstall notification are notified. |
271 base::MessageLoop::current()->PostTask( | 273 base::MessageLoop::current()->PostTask( |
272 FROM_HERE, | 274 FROM_HERE, |
273 base::Bind(&AppListMainView::QueryChanged, | 275 base::Bind(&AppListMainView::QueryChanged, |
274 weak_ptr_factory_.GetWeakPtr(), | 276 weak_ptr_factory_.GetWeakPtr(), |
275 search_box_view_)); | 277 search_box_view_)); |
276 } | 278 } |
277 | 279 |
278 } // namespace app_list | 280 } // namespace app_list |
OLD | NEW |