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/search_result_list_view.h" | 5 #include "ui/app_list/views/search_result_list_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/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 void SearchResultListView::VisibilityChanged(views::View* starting_from, | 194 void SearchResultListView::VisibilityChanged(views::View* starting_from, |
195 bool is_visible) { | 195 bool is_visible) { |
196 if (!is_visible) { | 196 if (!is_visible) { |
197 auto_launch_indicator_->SetVisible(false); | 197 auto_launch_indicator_->SetVisible(false); |
198 auto_launch_animation_.reset(); | 198 auto_launch_animation_.reset(); |
199 } | 199 } |
200 } | 200 } |
201 | 201 |
202 void SearchResultListView::AnimationEnded(const gfx::Animation* animation) { | 202 void SearchResultListView::AnimationEnded(const gfx::Animation* animation) { |
203 DCHECK_EQ(auto_launch_animation_.get(), animation); | 203 DCHECK_EQ(auto_launch_animation_.get(), animation); |
204 delegate_->OpenResult(results_->GetItemAt(0), ui::EF_NONE); | 204 delegate_->OpenResult(results_->GetItemAt(0), true, ui::EF_NONE); |
205 } | 205 } |
206 | 206 |
207 void SearchResultListView::AnimationProgressed( | 207 void SearchResultListView::AnimationProgressed( |
208 const gfx::Animation* animation) { | 208 const gfx::Animation* animation) { |
209 DCHECK_EQ(auto_launch_animation_.get(), animation); | 209 DCHECK_EQ(auto_launch_animation_.get(), animation); |
210 int indicator_width = auto_launch_animation_->CurrentValueBetween(0, width()); | 210 int indicator_width = auto_launch_animation_->CurrentValueBetween(0, width()); |
211 auto_launch_indicator_->SetBounds( | 211 auto_launch_indicator_->SetBounds( |
212 0, 0, indicator_width, kTimeoutIndicatorHeight); | 212 0, 0, indicator_width, kTimeoutIndicatorHeight); |
213 } | 213 } |
214 | 214 |
(...skipping 15 matching lines...) Expand all Loading... |
230 NOTREACHED(); | 230 NOTREACHED(); |
231 } | 231 } |
232 | 232 |
233 void SearchResultListView::ListItemsChanged(size_t start, size_t count) { | 233 void SearchResultListView::ListItemsChanged(size_t start, size_t count) { |
234 ScheduleUpdate(); | 234 ScheduleUpdate(); |
235 } | 235 } |
236 | 236 |
237 void SearchResultListView::SearchResultActivated(SearchResultView* view, | 237 void SearchResultListView::SearchResultActivated(SearchResultView* view, |
238 int event_flags) { | 238 int event_flags) { |
239 if (delegate_ && view->result()) | 239 if (delegate_ && view->result()) |
240 delegate_->OpenResult(view->result(), event_flags); | 240 delegate_->OpenResult(view->result(), false, event_flags); |
241 } | 241 } |
242 | 242 |
243 void SearchResultListView::SearchResultActionActivated(SearchResultView* view, | 243 void SearchResultListView::SearchResultActionActivated(SearchResultView* view, |
244 size_t action_index, | 244 size_t action_index, |
245 int event_flags) { | 245 int event_flags) { |
246 if (delegate_ && view->result()) { | 246 if (delegate_ && view->result()) { |
247 delegate_->InvokeResultAction( | 247 delegate_->InvokeResultAction( |
248 view->result(), action_index, event_flags); | 248 view->result(), action_index, event_flags); |
249 } | 249 } |
250 } | 250 } |
251 | 251 |
252 void SearchResultListView::OnSearchResultInstalled(SearchResultView* view) { | 252 void SearchResultListView::OnSearchResultInstalled(SearchResultView* view) { |
253 if (delegate_ && view->result()) | 253 if (delegate_ && view->result()) |
254 delegate_->OnResultInstalled(view->result()); | 254 delegate_->OnResultInstalled(view->result()); |
255 } | 255 } |
256 | 256 |
257 void SearchResultListView::OnSearchResultUninstalled(SearchResultView* view) { | 257 void SearchResultListView::OnSearchResultUninstalled(SearchResultView* view) { |
258 if (delegate_ && view->result()) | 258 if (delegate_ && view->result()) |
259 delegate_->OnResultUninstalled(view->result()); | 259 delegate_->OnResultUninstalled(view->result()); |
260 } | 260 } |
261 | 261 |
262 } // namespace app_list | 262 } // namespace app_list |
OLD | NEW |