| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 shelves_.insert(shelf); | 1149 shelves_.insert(shelf); |
| 1150 shelf->shelf_layout_manager()->AddObserver(this); | 1150 shelf->shelf_layout_manager()->AddObserver(this); |
| 1151 } | 1151 } |
| 1152 | 1152 |
| 1153 void ChromeLauncherController::OnShelfDestroyed(ash::Shelf* shelf) { | 1153 void ChromeLauncherController::OnShelfDestroyed(ash::Shelf* shelf) { |
| 1154 shelves_.erase(shelf); | 1154 shelves_.erase(shelf); |
| 1155 // RemoveObserver is not called here, since by the time this method is called | 1155 // RemoveObserver is not called here, since by the time this method is called |
| 1156 // Shelf is already in its destructor. | 1156 // Shelf is already in its destructor. |
| 1157 } | 1157 } |
| 1158 | 1158 |
| 1159 void ChromeLauncherController::OnAlignmentChanged( |
| 1160 ash::ShelfAlignment alignment) { |
| 1161 // TODO(msw): Anything? |
| 1162 } |
| 1163 |
| 1164 void ChromeLauncherController::OnAutoHideBehaviorChanged( |
| 1165 ash::ShelfAutoHideBehavior auto_hide) { |
| 1166 // TODO(msw): Anything? |
| 1167 } |
| 1168 |
| 1159 void ChromeLauncherController::ShelfItemAdded(int index) { | 1169 void ChromeLauncherController::ShelfItemAdded(int index) { |
| 1160 // The app list launcher can get added to the shelf after we applied the | 1170 // The app list launcher can get added to the shelf after we applied the |
| 1161 // preferences. In that case the item might be at the wrong spot. As such we | 1171 // preferences. In that case the item might be at the wrong spot. As such we |
| 1162 // call the function again. | 1172 // call the function again. |
| 1163 if (model_->items()[index].type == ash::TYPE_APP_LIST) | 1173 if (model_->items()[index].type == ash::TYPE_APP_LIST) |
| 1164 UpdateAppLaunchersFromPref(); | 1174 UpdateAppLaunchersFromPref(); |
| 1165 } | 1175 } |
| 1166 | 1176 |
| 1167 void ChromeLauncherController::ShelfItemRemoved(int index, ash::ShelfID id) { | 1177 void ChromeLauncherController::ShelfItemRemoved(int index, ash::ShelfID id) { |
| 1168 // TODO(skuhne): This fixes crbug.com/429870, but it does not answer why we | 1178 // TODO(skuhne): This fixes crbug.com/429870, but it does not answer why we |
| (...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2228 | 2238 |
| 2229 AppIconLoader* ChromeLauncherController::GetAppIconLoaderForApp( | 2239 AppIconLoader* ChromeLauncherController::GetAppIconLoaderForApp( |
| 2230 const std::string& app_id) { | 2240 const std::string& app_id) { |
| 2231 for (const auto& app_icon_loader : app_icon_loaders_) { | 2241 for (const auto& app_icon_loader : app_icon_loaders_) { |
| 2232 if (app_icon_loader->CanLoadImageForApp(app_id)) | 2242 if (app_icon_loader->CanLoadImageForApp(app_id)) |
| 2233 return app_icon_loader.get(); | 2243 return app_icon_loader.get(); |
| 2234 } | 2244 } |
| 2235 | 2245 |
| 2236 return nullptr; | 2246 return nullptr; |
| 2237 } | 2247 } |
| OLD | NEW |