| 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/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 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 app_list::AppListSyncableServiceFactory::GetForProfile(profile()); | 1241 app_list::AppListSyncableServiceFactory::GetForProfile(profile()); |
| 1242 if (app_service) | 1242 if (app_service) |
| 1243 app_service->RemoveObserver(this); | 1243 app_service->RemoveObserver(this); |
| 1244 | 1244 |
| 1245 PrefServiceSyncableFromProfile(profile())->RemoveObserver(this); | 1245 PrefServiceSyncableFromProfile(profile())->RemoveObserver(this); |
| 1246 } | 1246 } |
| 1247 | 1247 |
| 1248 /////////////////////////////////////////////////////////////////////////////// | 1248 /////////////////////////////////////////////////////////////////////////////// |
| 1249 // ash::mojom::ShelfObserver: | 1249 // ash::mojom::ShelfObserver: |
| 1250 | 1250 |
| 1251 void ChromeLauncherController::OnShelfCreated(int64_t display_id) { | 1251 void ChromeLauncherController::OnShelfInitialized(int64_t display_id) { |
| 1252 if (!ConnectToShelfController()) | 1252 if (!ConnectToShelfController()) |
| 1253 return; | 1253 return; |
| 1254 | 1254 |
| 1255 // The pref helper functions return default values for invalid display ids. | 1255 // The pref helper functions return default values for invalid display ids. |
| 1256 PrefService* prefs = profile_->GetPrefs(); | 1256 PrefService* prefs = profile_->GetPrefs(); |
| 1257 shelf_controller_->SetAlignment(GetShelfAlignmentPref(prefs, display_id), | 1257 shelf_controller_->SetAlignment(GetShelfAlignmentPref(prefs, display_id), |
| 1258 display_id); | 1258 display_id); |
| 1259 shelf_controller_->SetAutoHideBehavior( | 1259 shelf_controller_->SetAutoHideBehavior( |
| 1260 GetShelfAutoHideBehaviorPref(prefs, display_id), display_id); | 1260 GetShelfAutoHideBehaviorPref(prefs, display_id), display_id); |
| 1261 } | 1261 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1402 : IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE); | 1402 : IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE); |
| 1403 | 1403 |
| 1404 const int app_list_index = model_->GetItemIndexForType(ash::TYPE_APP_LIST); | 1404 const int app_list_index = model_->GetItemIndexForType(ash::TYPE_APP_LIST); |
| 1405 DCHECK_GE(app_list_index, 0); | 1405 DCHECK_GE(app_list_index, 0); |
| 1406 ash::ShelfItem item = model_->items()[app_list_index]; | 1406 ash::ShelfItem item = model_->items()[app_list_index]; |
| 1407 if (item.title != title) { | 1407 if (item.title != title) { |
| 1408 item.title = title; | 1408 item.title = title; |
| 1409 model_->Set(app_list_index, item); | 1409 model_->Set(app_list_index, item); |
| 1410 } | 1410 } |
| 1411 } | 1411 } |
| OLD | NEW |