Correct blacklist entry message
[chromium-blink-merge.git] / ui / app_list / app_list_item_model.cc
blob1846f5e0373579f16d00ff18f06adbb7c6e67fb9
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(const std::string& id)
13 : id_(id),
14 highlighted_(false),
15 is_installing_(false),
16 percent_downloaded_(-1) {
19 AppListItemModel::~AppListItemModel() {
22 void AppListItemModel::SetIcon(const gfx::ImageSkia& icon, bool has_shadow) {
23 icon_ = icon;
24 has_shadow_ = has_shadow;
25 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemIconChanged());
28 void AppListItemModel::SetTitleAndFullName(const std::string& title,
29 const std::string& full_name) {
30 if (title_ == title && full_name_ == full_name)
31 return;
33 title_ = title;
34 full_name_ = full_name;
35 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemTitleChanged());
38 void AppListItemModel::SetHighlighted(bool highlighted) {
39 if (highlighted_ == highlighted)
40 return;
42 highlighted_ = highlighted;
43 FOR_EACH_OBSERVER(AppListItemModelObserver,
44 observers_,
45 ItemHighlightedChanged());
48 void AppListItemModel::SetIsInstalling(bool is_installing) {
49 if (is_installing_ == is_installing)
50 return;
52 is_installing_ = is_installing;
53 FOR_EACH_OBSERVER(AppListItemModelObserver,
54 observers_,
55 ItemIsInstallingChanged());
58 void AppListItemModel::SetPercentDownloaded(int percent_downloaded) {
59 if (percent_downloaded_ == percent_downloaded)
60 return;
62 percent_downloaded_ = percent_downloaded;
63 FOR_EACH_OBSERVER(AppListItemModelObserver,
64 observers_,
65 ItemPercentDownloadedChanged());
68 void AppListItemModel::AddObserver(AppListItemModelObserver* observer) {
69 observers_.AddObserver(observer);
72 void AppListItemModel::RemoveObserver(AppListItemModelObserver* observer) {
73 observers_.RemoveObserver(observer);
76 void AppListItemModel::Activate(int event_flags) {
79 const char* AppListItemModel::GetAppType() const {
80 static const char* app_type = "";
81 return app_type;
84 ui::MenuModel* AppListItemModel::GetContextMenuModel() {
85 return NULL;
88 } // namespace app_list