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

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

Issue 20656002: Add profile selector menu to app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: small fixups Created 7 years, 4 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 unified diff | Download patch
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 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 if (ShouldDisplayInAppLauncher(profile_, *app)) 165 if (ShouldDisplayInAppLauncher(profile_, *app))
166 apps->push_back(new ExtensionAppItem(profile_, 166 apps->push_back(new ExtensionAppItem(profile_,
167 (*app)->id(), 167 (*app)->id(),
168 controller_, 168 controller_,
169 "", 169 "",
170 gfx::ImageSkia(), 170 gfx::ImageSkia(),
171 (*app)->is_platform_app())); 171 (*app)->is_platform_app()));
172 } 172 }
173 } 173 }
174 174
175 void AppsModelBuilder::SetProfile(Profile* profile) {
176 profile_ = profile;
177 model_->DeleteAll();
178 if (tracker_) {
koz (OOO until 15th September) 2013/08/02 01:51:16 nit: no curlies
calamity 2013/08/02 09:59:54 Done.
179 tracker_->RemoveObserver(this);
180 }
181 Build();
182 }
183
175 void AppsModelBuilder::PopulateApps() { 184 void AppsModelBuilder::PopulateApps() {
176 ExtensionService* service = 185 ExtensionService* service =
177 extensions::ExtensionSystem::Get(profile_)->extension_service(); 186 extensions::ExtensionSystem::Get(profile_)->extension_service();
178 if (!service) 187 if (!service)
179 return; 188 return;
180 189
181 Apps apps; 190 Apps apps;
182 AddApps(service->extensions(), &apps); 191 AddApps(service->extensions(), &apps);
183 AddApps(service->disabled_extensions(), &apps); 192 AddApps(service->disabled_extensions(), &apps);
184 AddApps(service->terminated_extensions(), &apps); 193 AddApps(service->terminated_extensions(), &apps);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 324
316 ExtensionAppItem* prev = target_index > 0 ? GetAppAt(target_index - 1) : NULL; 325 ExtensionAppItem* prev = target_index > 0 ? GetAppAt(target_index - 1) : NULL;
317 ExtensionAppItem* next = target_index + 1 < model_->item_count() ? 326 ExtensionAppItem* next = target_index + 1 < model_->item_count() ?
318 GetAppAt(target_index + 1) : NULL; 327 GetAppAt(target_index + 1) : NULL;
319 GetAppAt(target_index)->Move(prev, next); 328 GetAppAt(target_index)->Move(prev, next);
320 } 329 }
321 330
322 void AppsModelBuilder::ListItemsChanged(size_t start, size_t count) { 331 void AppsModelBuilder::ListItemsChanged(size_t start, size_t count) {
323 NOTREACHED(); 332 NOTREACHED();
324 } 333 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698