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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc

Issue 2889673002: chromeos: Refactor shelf to create ShelfView earlier in startup (Closed)
Patch Set: rebase Created 3 years, 7 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 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/ash/launcher/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include "ash/multi_profile_uma.h" 7 #include "ash/multi_profile_uma.h"
8 #include "ash/public/cpp/shelf_item.h" 8 #include "ash/public/cpp/shelf_item.h"
9 #include "ash/public/interfaces/constants.mojom.h" 9 #include "ash/public/interfaces/constants.mojom.h"
10 #include "ash/resources/grit/ash_resources.h" 10 #include "ash/resources/grit/ash_resources.h"
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 app_list::AppListSyncableServiceFactory::GetForProfile(profile()); 1233 app_list::AppListSyncableServiceFactory::GetForProfile(profile());
1234 if (app_service) 1234 if (app_service)
1235 app_service->RemoveObserver(this); 1235 app_service->RemoveObserver(this);
1236 1236
1237 PrefServiceSyncableFromProfile(profile())->RemoveObserver(this); 1237 PrefServiceSyncableFromProfile(profile())->RemoveObserver(this);
1238 } 1238 }
1239 1239
1240 /////////////////////////////////////////////////////////////////////////////// 1240 ///////////////////////////////////////////////////////////////////////////////
1241 // ash::mojom::ShelfObserver: 1241 // ash::mojom::ShelfObserver:
1242 1242
1243 void ChromeLauncherController::OnShelfCreated(int64_t display_id) { 1243 void ChromeLauncherController::OnShelfInitialized(int64_t display_id) {
1244 if (!ConnectToShelfController()) 1244 if (!ConnectToShelfController())
1245 return; 1245 return;
1246 1246
1247 // The pref helper functions return default values for invalid display ids. 1247 // The pref helper functions return default values for invalid display ids.
1248 PrefService* prefs = profile_->GetPrefs(); 1248 PrefService* prefs = profile_->GetPrefs();
1249 shelf_controller_->SetAlignment(GetShelfAlignmentPref(prefs, display_id), 1249 shelf_controller_->SetAlignment(GetShelfAlignmentPref(prefs, display_id),
1250 display_id); 1250 display_id);
1251 shelf_controller_->SetAutoHideBehavior( 1251 shelf_controller_->SetAutoHideBehavior(
1252 GetShelfAutoHideBehaviorPref(prefs, display_id), display_id); 1252 GetShelfAutoHideBehaviorPref(prefs, display_id), display_id);
1253 } 1253 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 : IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE); 1375 : IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE);
1376 1376
1377 const int app_list_index = model_->GetItemIndexForType(ash::TYPE_APP_LIST); 1377 const int app_list_index = model_->GetItemIndexForType(ash::TYPE_APP_LIST);
1378 DCHECK_GE(app_list_index, 0); 1378 DCHECK_GE(app_list_index, 0);
1379 ash::ShelfItem item = model_->items()[app_list_index]; 1379 ash::ShelfItem item = model_->items()[app_list_index];
1380 if (item.title != title) { 1380 if (item.title != title) {
1381 item.title = title; 1381 item.title = title;
1382 model_->Set(app_list_index, item); 1382 model_->Set(app_list_index, item);
1383 } 1383 }
1384 } 1384 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698