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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 pagination_model_->SelectPage(0, false /* animate */); | 163 pagination_model_->SelectPage(0, false /* animate */); |
164 AddContentsView(); | 164 AddContentsView(); |
165 Layout(); | 165 Layout(); |
166 } | 166 } |
167 | 167 |
168 void AppListMainView::SetDragAndDropHostOfCurrentAppList( | 168 void AppListMainView::SetDragAndDropHostOfCurrentAppList( |
169 ApplicationDragAndDropHost* drag_and_drop_host) { | 169 ApplicationDragAndDropHost* drag_and_drop_host) { |
170 contents_view_->SetDragAndDropHostOfCurrentAppList(drag_and_drop_host); | 170 contents_view_->SetDragAndDropHostOfCurrentAppList(drag_and_drop_host); |
171 } | 171 } |
172 | 172 |
173 bool AppListMainView::ShouldCenterWindow() const { | |
174 return delegate_->ShouldCenterWindow(); | |
175 } | |
176 | |
177 void AppListMainView::PreloadIcons(gfx::NativeView parent) { | 173 void AppListMainView::PreloadIcons(gfx::NativeView parent) { |
178 ui::ScaleFactor scale_factor = ui::SCALE_FACTOR_100P; | 174 ui::ScaleFactor scale_factor = ui::SCALE_FACTOR_100P; |
179 if (parent) | 175 if (parent) |
180 scale_factor = ui::GetScaleFactorForNativeView(parent); | 176 scale_factor = ui::GetScaleFactorForNativeView(parent); |
181 | 177 |
182 float scale = ui::GetImageScale(scale_factor); | 178 float scale = ui::GetImageScale(scale_factor); |
183 // |pagination_model| could have -1 as the initial selected page and | 179 // |pagination_model| could have -1 as the initial selected page and |
184 // assumes first page (i.e. index 0) will be used in this case. | 180 // assumes first page (i.e. index 0) will be used in this case. |
185 const int selected_page = std::max(0, pagination_model_->selected_page()); | 181 const int selected_page = std::max(0, pagination_model_->selected_page()); |
186 | 182 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 // Resubmit the query via a posted task so that all observers for the | 255 // Resubmit the query via a posted task so that all observers for the |
260 // uninstall notification are notified. | 256 // uninstall notification are notified. |
261 base::MessageLoop::current()->PostTask( | 257 base::MessageLoop::current()->PostTask( |
262 FROM_HERE, | 258 FROM_HERE, |
263 base::Bind(&AppListMainView::QueryChanged, | 259 base::Bind(&AppListMainView::QueryChanged, |
264 weak_ptr_factory_.GetWeakPtr(), | 260 weak_ptr_factory_.GetWeakPtr(), |
265 search_box_view_)); | 261 search_box_view_)); |
266 } | 262 } |
267 | 263 |
268 } // namespace app_list | 264 } // namespace app_list |
OLD | NEW |