| 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/app_list_item.h" | 5 #include "ui/app_list/app_list_item.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/app_list/app_list_item_observer.h" | 8 #include "ui/app_list/app_list_item_observer.h" |
| 9 | 9 |
| 10 namespace app_list { | 10 namespace app_list { |
| 11 | 11 |
| 12 AppListItem::AppListItem(const std::string& id) | 12 AppListItem::AppListItem(const std::string& id) |
| 13 : id_(id), | 13 : id_(id), |
| 14 has_shadow_(false), | |
| 15 highlighted_(false), | 14 highlighted_(false), |
| 16 is_installing_(false), | 15 is_installing_(false), |
| 17 percent_downloaded_(-1) { | 16 percent_downloaded_(-1) { |
| 18 } | 17 } |
| 19 | 18 |
| 20 AppListItem::~AppListItem() { | 19 AppListItem::~AppListItem() { |
| 21 FOR_EACH_OBSERVER(AppListItemObserver, observers_, ItemBeingDestroyed()); | 20 FOR_EACH_OBSERVER(AppListItemObserver, observers_, ItemBeingDestroyed()); |
| 22 } | 21 } |
| 23 | 22 |
| 24 void AppListItem::SetIcon(const gfx::ImageSkia& icon, bool has_shadow) { | 23 void AppListItem::SetIcon(const gfx::ImageSkia& icon) { |
| 25 icon_ = icon; | 24 icon_ = icon; |
| 26 has_shadow_ = has_shadow; | |
| 27 FOR_EACH_OBSERVER(AppListItemObserver, observers_, ItemIconChanged()); | 25 FOR_EACH_OBSERVER(AppListItemObserver, observers_, ItemIconChanged()); |
| 28 } | 26 } |
| 29 | 27 |
| 30 void AppListItem::SetIsInstalling(bool is_installing) { | 28 void AppListItem::SetIsInstalling(bool is_installing) { |
| 31 if (is_installing_ == is_installing) | 29 if (is_installing_ == is_installing) |
| 32 return; | 30 return; |
| 33 | 31 |
| 34 is_installing_ = is_installing; | 32 is_installing_ = is_installing; |
| 35 FOR_EACH_OBSERVER(AppListItemObserver, | 33 FOR_EACH_OBSERVER(AppListItemObserver, |
| 36 observers_, | 34 observers_, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 void AppListItem::SetNameAndShortName(const std::string& name, | 102 void AppListItem::SetNameAndShortName(const std::string& name, |
| 105 const std::string& short_name) { | 103 const std::string& short_name) { |
| 106 if (name_ == name && short_name_ == short_name) | 104 if (name_ == name && short_name_ == short_name) |
| 107 return; | 105 return; |
| 108 name_ = name; | 106 name_ = name; |
| 109 short_name_ = short_name; | 107 short_name_ = short_name; |
| 110 FOR_EACH_OBSERVER(AppListItemObserver, observers_, ItemNameChanged()); | 108 FOR_EACH_OBSERVER(AppListItemObserver, observers_, ItemNameChanged()); |
| 111 } | 109 } |
| 112 | 110 |
| 113 } // namespace app_list | 111 } // namespace app_list |
| OLD | NEW |