OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/app_list/model_pref_updater.h" | 5 #include "chrome/browser/ui/app_list/model_pref_updater.h" |
6 | 6 |
7 #include "chrome/browser/ui/app_list/app_list_prefs.h" | 7 #include "chrome/browser/ui/app_list/app_list_prefs.h" |
8 #include "chrome/browser/ui/app_list/extension_app_item.h" | 8 #include "chrome/browser/ui/app_list/extension_app_item.h" |
9 #include "ui/app_list/app_list_folder_item.h" | 9 #include "ui/app_list/app_list_folder_item.h" |
10 #include "ui/app_list/app_list_item.h" | 10 #include "ui/app_list/app_list_item.h" |
11 #include "ui/app_list/app_list_model.h" | 11 #include "ui/app_list/app_list_model.h" |
12 | 12 |
13 namespace app_list { | 13 namespace app_list { |
14 | 14 |
15 ModelPrefUpdater::ModelPrefUpdater(AppListPrefs* app_list_prefs, | 15 ModelPrefUpdater::ModelPrefUpdater(AppListPrefs* app_list_prefs, |
16 AppListModel* model) | 16 AppListModel* model) |
17 : app_list_prefs_(app_list_prefs), model_(model) { | 17 : app_list_prefs_(app_list_prefs), model_(model) { |
| 18 DLOG(ERROR) << "modelpref"; |
18 model_->AddObserver(this); | 19 model_->AddObserver(this); |
19 } | 20 } |
20 | 21 |
21 ModelPrefUpdater::~ModelPrefUpdater() { | 22 ModelPrefUpdater::~ModelPrefUpdater() { |
22 model_->RemoveObserver(this); | 23 model_->RemoveObserver(this); |
23 } | 24 } |
24 | 25 |
25 void ModelPrefUpdater::OnAppListItemAdded(AppListItem* item) { | 26 void ModelPrefUpdater::OnAppListItemAdded(AppListItem* item) { |
26 UpdatePrefsFromAppListItem(item); | 27 UpdatePrefsFromAppListItem(item); |
27 } | 28 } |
(...skipping 17 matching lines...) Expand all Loading... |
45 NOTREACHED(); | 46 NOTREACHED(); |
46 | 47 |
47 info.parent_id = item->folder_id(); | 48 info.parent_id = item->folder_id(); |
48 info.position = item->position(); | 49 info.position = item->position(); |
49 info.name = item->name(); | 50 info.name = item->name(); |
50 | 51 |
51 app_list_prefs_->SetAppListInfo(item->id(), info); | 52 app_list_prefs_->SetAppListInfo(item->id(), info); |
52 } | 53 } |
53 | 54 |
54 } // namespace app_list | 55 } // namespace app_list |
OLD | NEW |