| 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/app_list_item_model.h" | 5 #include "ui/app_list/app_list_item_model.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/app_list/app_list_item_model_observer.h" | 8 #include "ui/app_list/app_list_item_model_observer.h" |
| 9 | 9 |
| 10 namespace app_list { | 10 namespace app_list { |
| 11 | 11 |
| 12 AppListItemModel::AppListItemModel() | 12 AppListItemModel::AppListItemModel() |
| 13 : highlighted_(false), | 13 : highlighted_(false), |
| 14 is_installing_(false), | 14 is_installing_(false), |
| 15 percent_downloaded_(-1) { | 15 percent_downloaded_(-1) { |
| 16 } | 16 } |
| 17 | 17 |
| 18 AppListItemModel::~AppListItemModel() { | 18 AppListItemModel::~AppListItemModel() { |
| 19 } | 19 } |
| 20 | 20 |
| 21 void AppListItemModel::SetIcon(const gfx::ImageSkia& icon, bool has_shadow) { | 21 void AppListItemModel::SetIcon(const gfx::ImageSkia& icon, bool has_shadow) { |
| 22 icon_ = icon; | 22 icon_ = icon; |
| 23 has_shadow_ = has_shadow; | 23 has_shadow_ = has_shadow; |
| 24 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemIconChanged()); | 24 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemIconChanged()); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void AppListItemModel::SetTitle(const std::string& title) { | 27 void AppListItemModel::SetName(const std::string& title, |
| 28 if (title_ == title) | 28 const std::string& full_name) { |
| 29 if (title_ == title && full_name_ == full_name) |
| 29 return; | 30 return; |
| 30 | 31 |
| 31 title_ = title; | 32 title_ = title; |
| 33 full_name_ = full_name; |
| 32 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemTitleChanged()); | 34 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemTitleChanged()); |
| 33 } | 35 } |
| 34 | 36 |
| 35 void AppListItemModel::SetHighlighted(bool highlighted) { | 37 void AppListItemModel::SetHighlighted(bool highlighted) { |
| 36 if (highlighted_ == highlighted) | 38 if (highlighted_ == highlighted) |
| 37 return; | 39 return; |
| 38 | 40 |
| 39 highlighted_ = highlighted; | 41 highlighted_ = highlighted; |
| 40 FOR_EACH_OBSERVER(AppListItemModelObserver, | 42 FOR_EACH_OBSERVER(AppListItemModelObserver, |
| 41 observers_, | 43 observers_, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 68 | 70 |
| 69 void AppListItemModel::RemoveObserver(AppListItemModelObserver* observer) { | 71 void AppListItemModel::RemoveObserver(AppListItemModelObserver* observer) { |
| 70 observers_.RemoveObserver(observer); | 72 observers_.RemoveObserver(observer); |
| 71 } | 73 } |
| 72 | 74 |
| 73 ui::MenuModel* AppListItemModel::GetContextMenuModel() { | 75 ui::MenuModel* AppListItemModel::GetContextMenuModel() { |
| 74 return NULL; | 76 return NULL; |
| 75 } | 77 } |
| 76 | 78 |
| 77 } // namespace app_list | 79 } // namespace app_list |
| OLD | NEW |