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

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

Issue 598013003: Added views::ViewModelT<T>, a type-safe template version of ViewModel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@appsgridview-static-casts
Patch Set: DISALLOW_COPY_AND_ASSIGN. Created 6 years, 2 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
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 #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 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 13 matching lines...) Expand all
24 #include "ui/views/view_model.h" 24 #include "ui/views/view_model.h"
25 #include "ui/views/view_model_utils.h" 25 #include "ui/views/view_model_utils.h"
26 26
27 namespace app_list { 27 namespace app_list {
28 28
29 ContentsView::ContentsView(AppListMainView* app_list_main_view) 29 ContentsView::ContentsView(AppListMainView* app_list_main_view)
30 : search_results_view_(NULL), 30 : search_results_view_(NULL),
31 start_page_view_(NULL), 31 start_page_view_(NULL),
32 app_list_main_view_(app_list_main_view), 32 app_list_main_view_(app_list_main_view),
33 contents_switcher_view_(NULL), 33 contents_switcher_view_(NULL),
34 view_model_(new views::ViewModel), 34 view_model_(new views::ViewModel<views::View>),
35 page_before_search_(0) { 35 page_before_search_(0) {
36 pagination_model_.SetTransitionDurations(kPageTransitionDurationInMs, 36 pagination_model_.SetTransitionDurations(kPageTransitionDurationInMs,
37 kOverscrollPageTransitionDurationMs); 37 kOverscrollPageTransitionDurationMs);
38 pagination_model_.AddObserver(this); 38 pagination_model_.AddObserver(this);
39 } 39 }
40 40
41 ContentsView::~ContentsView() { 41 ContentsView::~ContentsView() {
42 pagination_model_.RemoveObserver(this); 42 pagination_model_.RemoveObserver(this);
43 if (contents_switcher_view_) 43 if (contents_switcher_view_)
44 pagination_model_.RemoveObserver(contents_switcher_view_); 44 pagination_model_.RemoveObserver(contents_switcher_view_);
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 } 309 }
310 310
311 void ContentsView::TransitionStarted() { 311 void ContentsView::TransitionStarted() {
312 } 312 }
313 313
314 void ContentsView::TransitionChanged() { 314 void ContentsView::TransitionChanged() {
315 UpdatePageBounds(); 315 UpdatePageBounds();
316 } 316 }
317 317
318 } // namespace app_list 318 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/contents_view.h ('k') | ui/views/view_model.h » ('j') | ui/views/view_model.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698