| OLD | NEW |
| 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 #include "ui/app_list/views/contents_view.h" | 5 #include "ui/app_list/views/contents_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 ContentsView::~ContentsView() { | 47 ContentsView::~ContentsView() { |
| 48 pagination_model_.RemoveObserver(this); | 48 pagination_model_.RemoveObserver(this); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void ContentsView::InitNamedPages(AppListModel* model, | 51 void ContentsView::InitNamedPages(AppListModel* model, |
| 52 AppListViewDelegate* view_delegate) { | 52 AppListViewDelegate* view_delegate) { |
| 53 DCHECK(model); | 53 DCHECK(model); |
| 54 | 54 |
| 55 if (app_list::switches::IsExperimentalAppListEnabled()) { | 55 if (app_list::switches::IsExperimentalAppListEnabled()) { |
| 56 views::View* custom_page_view = |
| 57 view_delegate->CreateCustomPageWebView(GetLocalBounds().size()); |
| 58 if (custom_page_view) |
| 59 AddLauncherPage(custom_page_view, IDR_APP_LIST_NOTIFICATIONS_ICON); |
| 60 |
| 56 start_page_view_ = new StartPageView(app_list_main_view_, view_delegate); | 61 start_page_view_ = new StartPageView(app_list_main_view_, view_delegate); |
| 57 AddLauncherPage( | 62 AddLauncherPage( |
| 58 start_page_view_, IDR_APP_LIST_SEARCH_ICON, NAMED_PAGE_START); | 63 start_page_view_, IDR_APP_LIST_SEARCH_ICON, NAMED_PAGE_START); |
| 59 } else { | 64 } else { |
| 60 search_results_view_ = | 65 search_results_view_ = |
| 61 new SearchResultListView(app_list_main_view_, view_delegate); | 66 new SearchResultListView(app_list_main_view_, view_delegate); |
| 62 AddLauncherPage(search_results_view_, 0, NAMED_PAGE_SEARCH_RESULTS); | 67 AddLauncherPage(search_results_view_, 0, NAMED_PAGE_SEARCH_RESULTS); |
| 63 search_results_view_->SetResults(model->results()); | 68 search_results_view_->SetResults(model->results()); |
| 64 } | 69 } |
| 65 | 70 |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 if (std::abs(offset) > kMinScrollToSwitchPage) { | 372 if (std::abs(offset) > kMinScrollToSwitchPage) { |
| 368 if (!GetAppsPaginationModel()->has_transition()) { | 373 if (!GetAppsPaginationModel()->has_transition()) { |
| 369 GetAppsPaginationModel()->SelectPageRelative(offset > 0 ? -1 : 1, true); | 374 GetAppsPaginationModel()->SelectPageRelative(offset > 0 ? -1 : 1, true); |
| 370 } | 375 } |
| 371 event->SetHandled(); | 376 event->SetHandled(); |
| 372 event->StopPropagation(); | 377 event->StopPropagation(); |
| 373 } | 378 } |
| 374 } | 379 } |
| 375 | 380 |
| 376 } // namespace app_list | 381 } // namespace app_list |
| OLD | NEW |