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

Side by Side Diff: chrome/browser/ui/app_list/apps_model_builder.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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/apps_model_builder.h" 5 #include "chrome/browser/ui/app_list/apps_model_builder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 } 201 }
202 case chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED: { 202 case chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED: {
203 ResortApps(); 203 ResortApps();
204 break; 204 break;
205 } 205 }
206 case chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST: { 206 case chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST: {
207 highlight_app_id_ = *content::Details<const std::string>(details).ptr(); 207 highlight_app_id_ = *content::Details<const std::string>(details).ptr();
208 HighlightApp(); 208 HighlightApp();
209 break; 209 break;
210 } 210 }
211 case chrome::NOTIFICATION_PREF_CHANGED: {
212 ResortApps();
213 break;
214 }
215 default: 211 default:
216 NOTREACHED(); 212 NOTREACHED();
217 } 213 }
218 } 214 }
219 215
216 void AppsModelBuilder::OnPreferenceChanged(PrefServiceBase* service,
217 const std::string& pref_name) {
218 ResortApps();
219 }
220
220 void AppsModelBuilder::ListItemsAdded(size_t start, size_t count) { 221 void AppsModelBuilder::ListItemsAdded(size_t start, size_t count) {
221 } 222 }
222 223
223 void AppsModelBuilder::ListItemsRemoved(size_t start, size_t count) { 224 void AppsModelBuilder::ListItemsRemoved(size_t start, size_t count) {
224 } 225 }
225 226
226 void AppsModelBuilder::ListItemMoved(size_t index, size_t target_index) { 227 void AppsModelBuilder::ListItemMoved(size_t index, size_t target_index) {
227 if (ignore_changes_) 228 if (ignore_changes_)
228 return; 229 return;
229 230
230 ExtensionAppItem* prev = target_index > 0 ? GetAppAt(target_index - 1) : NULL; 231 ExtensionAppItem* prev = target_index > 0 ? GetAppAt(target_index - 1) : NULL;
231 ExtensionAppItem* next = target_index + 1 < model_->item_count() ? 232 ExtensionAppItem* next = target_index + 1 < model_->item_count() ?
232 GetAppAt(target_index + 1) : NULL; 233 GetAppAt(target_index + 1) : NULL;
233 GetAppAt(target_index)->Move(prev, next); 234 GetAppAt(target_index)->Move(prev, next);
234 } 235 }
235 236
236 void AppsModelBuilder::ListItemsChanged(size_t start, size_t count) { 237 void AppsModelBuilder::ListItemsChanged(size_t start, size_t count) {
237 NOTREACHED(); 238 NOTREACHED();
238 } 239 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/apps_model_builder.h ('k') | chrome/browser/ui/ash/launcher/chrome_launcher_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698