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

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

Issue 22354002: Remove SetModel in ContentsView and SearchBoxView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove AppListModel stuff from SearchBoxView Created 7 years, 4 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
« no previous file with comments | « no previous file | ui/app_list/views/contents_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/callback.h" 9 #include "base/callback.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 search_box_view_(NULL), 83 search_box_view_(NULL),
84 contents_view_(NULL) { 84 contents_view_(NULL) {
85 // Starts icon loading early. 85 // Starts icon loading early.
86 PreloadIcons(pagination_model, anchor); 86 PreloadIcons(pagination_model, anchor);
87 87
88 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 88 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical,
89 kInnerPadding, 89 kInnerPadding,
90 kInnerPadding, 90 kInnerPadding,
91 kInnerPadding)); 91 kInnerPadding));
92 92
93 search_box_view_ = new SearchBoxView(this, delegate); 93 search_box_view_ = new SearchBoxView(this, delegate, model_);
94 AddChildView(search_box_view_); 94 AddChildView(search_box_view_);
95 95
96 contents_view_ = new ContentsView(this, pagination_model); 96 contents_view_ = new ContentsView(this, pagination_model, model_);
97 AddChildView(contents_view_); 97 AddChildView(contents_view_);
98 98
99 search_box_view_->set_contents_view(contents_view_); 99 search_box_view_->set_contents_view(contents_view_);
100 100
101 #if defined(USE_AURA) 101 #if defined(USE_AURA)
102 contents_view_->SetPaintToLayer(true); 102 contents_view_->SetPaintToLayer(true);
103 contents_view_->SetFillsBoundsOpaquely(false); 103 contents_view_->SetFillsBoundsOpaquely(false);
104 contents_view_->layer()->SetMasksToBounds(true); 104 contents_view_->layer()->SetMasksToBounds(true);
105 #endif 105 #endif
106
107 search_box_view_->SetModel(model_->search_box());
108 contents_view_->SetModel(model_);
109 } 106 }
110 107
111 AppListMainView::~AppListMainView() { 108 AppListMainView::~AppListMainView() {
112 pending_icon_loaders_.clear(); 109 pending_icon_loaders_.clear();
113 } 110 }
114 111
115 void AppListMainView::ShowAppListWhenReady() { 112 void AppListMainView::ShowAppListWhenReady() {
116 if (pending_icon_loaders_.empty()) { 113 if (pending_icon_loaders_.empty()) {
117 icon_loading_wait_timer_.Stop(); 114 icon_loading_wait_timer_.Stop();
118 GetWidget()->Show(); 115 GetWidget()->Show();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 delegate_->InvokeSearchResultAction(result, action_index, event_flags); 223 delegate_->InvokeSearchResultAction(result, action_index, event_flags);
227 } 224 }
228 225
229 void AppListMainView::OnResultInstalled(SearchResult* result) { 226 void AppListMainView::OnResultInstalled(SearchResult* result) {
230 // Clears the search to show the apps grid. The last installed app 227 // Clears the search to show the apps grid. The last installed app
231 // should be highlighted and made visible already. 228 // should be highlighted and made visible already.
232 search_box_view_->ClearSearch(); 229 search_box_view_->ClearSearch();
233 } 230 }
234 231
235 } // namespace app_list 232 } // namespace app_list
OLDNEW
« no previous file with comments | « no previous file | ui/app_list/views/contents_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698