Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: chrome/browser/ui/app_list/model_pref_updater.cc

Issue 2430753002: Discard unused AppListPrefs code. (Closed)
Patch Set: update Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/model_pref_updater.cc
diff --git a/chrome/browser/ui/app_list/model_pref_updater.cc b/chrome/browser/ui/app_list/model_pref_updater.cc
deleted file mode 100644
index 5acd7c402d1d404c284c044c3e5cd81d1ab9c596..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/app_list/model_pref_updater.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/app_list/model_pref_updater.h"
-
-#include "build/build_config.h"
-#include "chrome/browser/ui/app_list/app_list_prefs.h"
-#include "chrome/browser/ui/app_list/extension_app_item.h"
-#include "ui/app_list/app_list_folder_item.h"
-#include "ui/app_list/app_list_item.h"
-#include "ui/app_list/app_list_model.h"
-
-#if defined(OS_CHROMEOS)
-#include "chrome/browser/ui/app_list/arc/arc_app_item.h"
-#endif
-
-namespace app_list {
-
-ModelPrefUpdater::ModelPrefUpdater(AppListPrefs* app_list_prefs,
- AppListModel* model)
- : app_list_prefs_(app_list_prefs), model_(model) {
- model_->AddObserver(this);
-}
-
-ModelPrefUpdater::~ModelPrefUpdater() {
- model_->RemoveObserver(this);
-}
-
-void ModelPrefUpdater::OnAppListItemAdded(AppListItem* item) {
- UpdatePrefsFromAppListItem(item);
-}
-
-void ModelPrefUpdater::OnAppListItemWillBeDeleted(AppListItem* item) {
- app_list_prefs_->DeleteAppListInfo(item->id());
-}
-
-void ModelPrefUpdater::OnAppListItemUpdated(AppListItem* item) {
- UpdatePrefsFromAppListItem(item);
-}
-
-void ModelPrefUpdater::UpdatePrefsFromAppListItem(AppListItem* item) {
- // Write synced data to local pref.
- AppListPrefs::AppListInfo info;
- if (item->GetItemType() == AppListFolderItem::kItemType)
- info.item_type = AppListPrefs::AppListInfo::FOLDER_ITEM;
- else if (item->GetItemType() == ExtensionAppItem::kItemType)
- info.item_type = AppListPrefs::AppListInfo::APP_ITEM;
-#if defined(OS_CHROMEOS)
- else if (item->GetItemType() == ArcAppItem::kItemType)
- info.item_type = AppListPrefs::AppListInfo::APP_ITEM;
-#endif
- else
- NOTREACHED();
-
- info.parent_id = item->folder_id();
- info.position = item->position();
- info.name = item->name();
-
- app_list_prefs_->SetAppListInfo(item->id(), info);
-}
-
-} // namespace app_list
« no previous file with comments | « chrome/browser/ui/app_list/model_pref_updater.h ('k') | chrome/browser/ui/app_list/model_pref_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698