| 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/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 106 |
| 107 search_box_view_->SetModel(model_->search_box()); | 107 search_box_view_->SetModel(model_); |
| 108 contents_view_->SetModel(model_); | 108 contents_view_->SetModel(model_); |
| 109 } | 109 } |
| 110 | 110 |
| 111 AppListMainView::~AppListMainView() { | 111 AppListMainView::~AppListMainView() { |
| 112 pending_icon_loaders_.clear(); | 112 pending_icon_loaders_.clear(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void AppListMainView::SetModel(AppListModel* model) { |
| 116 model_ = model; |
| 117 search_box_view_->SetModel(model_); |
| 118 contents_view_->SetModel(model_); |
| 119 } |
| 120 |
| 115 void AppListMainView::ShowAppListWhenReady() { | 121 void AppListMainView::ShowAppListWhenReady() { |
| 116 if (pending_icon_loaders_.empty()) { | 122 if (pending_icon_loaders_.empty()) { |
| 117 icon_loading_wait_timer_.Stop(); | 123 icon_loading_wait_timer_.Stop(); |
| 118 GetWidget()->Show(); | 124 GetWidget()->Show(); |
| 119 return; | 125 return; |
| 120 } | 126 } |
| 121 | 127 |
| 122 if (icon_loading_wait_timer_.IsRunning()) | 128 if (icon_loading_wait_timer_.IsRunning()) |
| 123 return; | 129 return; |
| 124 | 130 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 } | 226 } |
| 221 | 227 |
| 222 void AppListMainView::InvokeResultAction(SearchResult* result, | 228 void AppListMainView::InvokeResultAction(SearchResult* result, |
| 223 int action_index, | 229 int action_index, |
| 224 int event_flags) { | 230 int event_flags) { |
| 225 if (delegate_) | 231 if (delegate_) |
| 226 delegate_->InvokeSearchResultAction(result, action_index, event_flags); | 232 delegate_->InvokeSearchResultAction(result, action_index, event_flags); |
| 227 } | 233 } |
| 228 | 234 |
| 229 } // namespace app_list | 235 } // namespace app_list |
| OLD | NEW |