app_list_model.cc revision a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7
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. 4 5#include "ui/app_list/app_list_model.h" 6 7#include "ui/app_list/app_list_item_model.h" 8#include "ui/app_list/app_list_model_observer.h" 9#include "ui/app_list/search_box_model.h" 10#include "ui/app_list/search_result.h" 11 12namespace app_list { 13 14AppListModel::AppListModel() 15 : item_list_(new AppListItemList), 16 search_box_(new SearchBoxModel), 17 results_(new SearchResults), 18 status_(STATUS_NORMAL) { 19} 20 21AppListModel::~AppListModel() { 22} 23 24void AppListModel::AddObserver(AppListModelObserver* observer) { 25 observers_.AddObserver(observer); 26} 27 28void AppListModel::RemoveObserver(AppListModelObserver* observer) { 29 observers_.RemoveObserver(observer); 30} 31 32void AppListModel::SetStatus(Status status) { 33 if (status_ == status) 34 return; 35 36 status_ = status; 37 FOR_EACH_OBSERVER(AppListModelObserver, 38 observers_, 39 OnAppListModelStatusChanged()); 40} 41 42} // namespace app_list 43