| 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() : highlighted_(false) { | 12 AppListItemModel::AppListItemModel() : highlighted_(false) { |
| 13 } | 13 } |
| 14 | 14 |
| 15 AppListItemModel::~AppListItemModel() { | 15 AppListItemModel::~AppListItemModel() { |
| 16 } | 16 } |
| 17 | 17 |
| 18 void AppListItemModel::SetIcon(const gfx::ImageSkia& icon) { | 18 void AppListItemModel::SetIcon(const gfx::ImageSkia& icon) { |
| 19 icon_ = icon; | 19 icon_ = icon; |
| 20 DCHECK(icon.IsThreadSafe()); | |
| 21 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemIconChanged()); | 20 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemIconChanged()); |
| 22 } | 21 } |
| 23 | 22 |
| 24 void AppListItemModel::SetTitle(const std::string& title) { | 23 void AppListItemModel::SetTitle(const std::string& title) { |
| 25 if (title_ == title) | 24 if (title_ == title) |
| 26 return; | 25 return; |
| 27 | 26 |
| 28 title_ = title; | 27 title_ = title; |
| 29 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemTitleChanged()); | 28 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemTitleChanged()); |
| 30 } | 29 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 45 | 44 |
| 46 void AppListItemModel::RemoveObserver(AppListItemModelObserver* observer) { | 45 void AppListItemModel::RemoveObserver(AppListItemModelObserver* observer) { |
| 47 observers_.RemoveObserver(observer); | 46 observers_.RemoveObserver(observer); |
| 48 } | 47 } |
| 49 | 48 |
| 50 ui::MenuModel* AppListItemModel::GetContextMenuModel() { | 49 ui::MenuModel* AppListItemModel::GetContextMenuModel() { |
| 51 return NULL; | 50 return NULL; |
| 52 } | 51 } |
| 53 | 52 |
| 54 } // namespace app_list | 53 } // namespace app_list |
| OLD | NEW |