Mailbox support for texture layers.
[chromium-blink-merge.git] / ui / app_list / app_list_item_model.cc
blobc3a74bfee59a5fc881720167a2544112cf863b36
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
3 // found in the LICENSE file.
5 #include "ui/app_list/app_list_item_model.h"
7 #include "base/logging.h"
8 #include "ui/app_list/app_list_item_model_observer.h"
10 namespace app_list {
12 AppListItemModel::AppListItemModel() : highlighted_(false) {
15 AppListItemModel::~AppListItemModel() {
18 void AppListItemModel::SetIcon(const gfx::ImageSkia& icon) {
19 icon_ = icon;
20 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemIconChanged());
23 void AppListItemModel::SetTitle(const std::string& title) {
24 if (title_ == title)
25 return;
27 title_ = title;
28 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemTitleChanged());
31 void AppListItemModel::SetHighlighted(bool highlighted) {
32 if (highlighted_ == highlighted)
33 return;
35 highlighted_ = highlighted;
36 FOR_EACH_OBSERVER(AppListItemModelObserver,
37 observers_,
38 ItemHighlightedChanged());
41 void AppListItemModel::AddObserver(AppListItemModelObserver* observer) {
42 observers_.AddObserver(observer);
45 void AppListItemModel::RemoveObserver(AppListItemModelObserver* observer) {
46 observers_.RemoveObserver(observer);
49 ui::MenuModel* AppListItemModel::GetContextMenuModel() {
50 return NULL;
53 } // namespace app_list