| 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_view.h" | 5 #include "ui/app_list/views/search_result_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/app_list/app_list_constants.h" | 9 #include "ui/app_list/app_list_constants.h" |
| 10 #include "ui/app_list/search_result.h" | 10 #include "ui/app_list/search_result.h" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 273 |
| 274 void SearchResultView::OnPercentDownloadedChanged() { | 274 void SearchResultView::OnPercentDownloadedChanged() { |
| 275 progress_bar_->SetValue(result_->percent_downloaded() / 100.0); | 275 progress_bar_->SetValue(result_->percent_downloaded() / 100.0); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void SearchResultView::OnItemInstalled() { | 278 void SearchResultView::OnItemInstalled() { |
| 279 delegate_->OnSearchResultInstalled(this); | 279 delegate_->OnSearchResultInstalled(this); |
| 280 } | 280 } |
| 281 | 281 |
| 282 void SearchResultView::OnItemUninstalled() { | 282 void SearchResultView::OnItemUninstalled() { |
| 283 DLOG(INFO) << "UNINSTALL OBSERVED"; |
| 283 delegate_->OnSearchResultUninstalled(this); | 284 delegate_->OnSearchResultUninstalled(this); |
| 284 } | 285 } |
| 285 | 286 |
| 286 void SearchResultView::OnSearchResultActionActivated(size_t index, | 287 void SearchResultView::OnSearchResultActionActivated(size_t index, |
| 287 int event_flags) { | 288 int event_flags) { |
| 288 DCHECK(result_); | 289 DCHECK(result_); |
| 289 DCHECK_LT(index, result_->actions().size()); | 290 DCHECK_LT(index, result_->actions().size()); |
| 290 | 291 |
| 291 delegate_->SearchResultActionActivated(this, index, event_flags); | 292 delegate_->SearchResultActionActivated(this, index, event_flags); |
| 292 } | 293 } |
| 293 | 294 |
| 294 void SearchResultView::ShowContextMenuForView(views::View* source, | 295 void SearchResultView::ShowContextMenuForView(views::View* source, |
| 295 const gfx::Point& point, | 296 const gfx::Point& point, |
| 296 ui::MenuSourceType source_type) { | 297 ui::MenuSourceType source_type) { |
| 297 ui::MenuModel* menu_model = result_->GetContextMenuModel(); | 298 ui::MenuModel* menu_model = result_->GetContextMenuModel(); |
| 298 if (!menu_model) | 299 if (!menu_model) |
| 299 return; | 300 return; |
| 300 | 301 |
| 301 context_menu_runner_.reset(new views::MenuRunner(menu_model)); | 302 context_menu_runner_.reset(new views::MenuRunner(menu_model)); |
| 302 if (context_menu_runner_->RunMenuAt( | 303 if (context_menu_runner_->RunMenuAt( |
| 303 GetWidget(), NULL, gfx::Rect(point, gfx::Size()), | 304 GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
| 304 views::MenuItemView::TOPLEFT, source_type, | 305 views::MenuItemView::TOPLEFT, source_type, |
| 305 views::MenuRunner::HAS_MNEMONICS) == | 306 views::MenuRunner::HAS_MNEMONICS) == |
| 306 views::MenuRunner::MENU_DELETED) | 307 views::MenuRunner::MENU_DELETED) |
| 307 return; | 308 return; |
| 308 } | 309 } |
| 309 | 310 |
| 310 } // namespace app_list | 311 } // namespace app_list |
| OLD | NEW |