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/app_list_item_view.h" | 5 #include "ui/app_list/views/app_list_item_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 AddChildView(progress_bar_); | 113 AddChildView(progress_bar_); |
114 | 114 |
115 SetIcon(item->icon()); | 115 SetIcon(item->icon()); |
116 SetItemName(base::UTF8ToUTF16(item->GetDisplayName()), | 116 SetItemName(base::UTF8ToUTF16(item->GetDisplayName()), |
117 base::UTF8ToUTF16(item->name())); | 117 base::UTF8ToUTF16(item->name())); |
118 SetItemIsInstalling(item->is_installing()); | 118 SetItemIsInstalling(item->is_installing()); |
119 SetItemIsHighlighted(item->highlighted()); | 119 SetItemIsHighlighted(item->highlighted()); |
120 item->AddObserver(this); | 120 item->AddObserver(this); |
121 | 121 |
122 set_context_menu_controller(this); | 122 set_context_menu_controller(this); |
123 set_request_focus_on_press(false); | |
124 | 123 |
125 SetAnimationDuration(0); | 124 SetAnimationDuration(0); |
126 } | 125 } |
127 | 126 |
128 AppListItemView::~AppListItemView() { | 127 AppListItemView::~AppListItemView() { |
129 if (item_weak_) | 128 if (item_weak_) |
130 item_weak_->RemoveObserver(this); | 129 item_weak_->RemoveObserver(this); |
131 } | 130 } |
132 | 131 |
133 void AppListItemView::SetIcon(const gfx::ImageSkia& icon) { | 132 void AppListItemView::SetIcon(const gfx::ImageSkia& icon) { |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 SetItemPercentDownloaded(item_weak_->percent_downloaded()); | 572 SetItemPercentDownloaded(item_weak_->percent_downloaded()); |
574 } | 573 } |
575 | 574 |
576 void AppListItemView::ItemBeingDestroyed() { | 575 void AppListItemView::ItemBeingDestroyed() { |
577 DCHECK(item_weak_); | 576 DCHECK(item_weak_); |
578 item_weak_->RemoveObserver(this); | 577 item_weak_->RemoveObserver(this); |
579 item_weak_ = NULL; | 578 item_weak_ = NULL; |
580 } | 579 } |
581 | 580 |
582 } // namespace app_list | 581 } // namespace app_list |
OLD | NEW |