gpu: Tweak Android WebGL test expectations
[chromium-blink-merge.git] / ui / app_list / app_list_item_model.cc
blobc9aedb59be8e2163cae7483fa95937efb7f0d3df
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()
13 : highlighted_(false),
14 is_installing_(false),
15 percent_downloaded_(-1) {
18 AppListItemModel::~AppListItemModel() {
21 void AppListItemModel::SetIcon(const gfx::ImageSkia& icon, bool has_shadow) {
22 icon_ = icon;
23 has_shadow_ = has_shadow;
24 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemIconChanged());
27 void AppListItemModel::SetTitle(const std::string& title) {
28 if (title_ == title)
29 return;
31 title_ = title;
32 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemTitleChanged());
35 void AppListItemModel::SetHighlighted(bool highlighted) {
36 if (highlighted_ == highlighted)
37 return;
39 highlighted_ = highlighted;
40 FOR_EACH_OBSERVER(AppListItemModelObserver,
41 observers_,
42 ItemHighlightedChanged());
45 void AppListItemModel::SetIsInstalling(bool is_installing) {
46 if (is_installing_ == is_installing)
47 return;
49 is_installing_ = is_installing;
50 FOR_EACH_OBSERVER(AppListItemModelObserver,
51 observers_,
52 ItemIsInstallingChanged());
55 void AppListItemModel::SetPercentDownloaded(int percent_downloaded) {
56 if (percent_downloaded_ == percent_downloaded)
57 return;
59 percent_downloaded_ = percent_downloaded;
60 FOR_EACH_OBSERVER(AppListItemModelObserver,
61 observers_,
62 ItemPercentDownloadedChanged());
65 void AppListItemModel::AddObserver(AppListItemModelObserver* observer) {
66 observers_.AddObserver(observer);
69 void AppListItemModel::RemoveObserver(AppListItemModelObserver* observer) {
70 observers_.RemoveObserver(observer);
73 ui::MenuModel* AppListItemModel::GetContextMenuModel() {
74 return NULL;
77 } // namespace app_list