| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 #endif | 372 #endif |
| 373 | 373 |
| 374 // Right now ash::Shell isn't created for tests. | 374 // Right now ash::Shell isn't created for tests. |
| 375 // TODO(mukai): Allows it to observe display change and write tests. | 375 // TODO(mukai): Allows it to observe display change and write tests. |
| 376 if (ash::Shell::HasInstance()) { | 376 if (ash::Shell::HasInstance()) { |
| 377 ash::Shell::GetInstance()->display_controller()->AddObserver(this); | 377 ash::Shell::GetInstance()->display_controller()->AddObserver(this); |
| 378 item_delegate_manager_ = | 378 item_delegate_manager_ = |
| 379 ash::Shell::GetInstance()->shelf_item_delegate_manager(); | 379 ash::Shell::GetInstance()->shelf_item_delegate_manager(); |
| 380 } | 380 } |
| 381 | 381 |
| 382 notification_registrar_.Add( | 382 notification_registrar_.Add(this, |
| 383 this, | 383 chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
| 384 chrome::NOTIFICATION_EXTENSION_LOADED, | 384 content::Source<Profile>(profile_)); |
| 385 content::Source<Profile>(profile_)); | |
| 386 notification_registrar_.Add( | 385 notification_registrar_.Add( |
| 387 this, | 386 this, |
| 388 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, | 387 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
| 389 content::Source<Profile>(profile_)); | 388 content::Source<Profile>(profile_)); |
| 390 } | 389 } |
| 391 | 390 |
| 392 ChromeLauncherController::~ChromeLauncherController() { | 391 ChromeLauncherController::~ChromeLauncherController() { |
| 393 // Reset the BrowserStatusMonitor as it has a weak pointer to this. | 392 // Reset the BrowserStatusMonitor as it has a weak pointer to this. |
| 394 browser_status_monitor_.reset(); | 393 browser_status_monitor_.reset(); |
| 395 | 394 |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 void ChromeLauncherController::AdditionalUserAddedToSession(Profile* profile) { | 1107 void ChromeLauncherController::AdditionalUserAddedToSession(Profile* profile) { |
| 1109 // Switch the running applications to the new user. | 1108 // Switch the running applications to the new user. |
| 1110 app_window_controller_->AdditionalUserAddedToSession(profile); | 1109 app_window_controller_->AdditionalUserAddedToSession(profile); |
| 1111 } | 1110 } |
| 1112 | 1111 |
| 1113 void ChromeLauncherController::Observe( | 1112 void ChromeLauncherController::Observe( |
| 1114 int type, | 1113 int type, |
| 1115 const content::NotificationSource& source, | 1114 const content::NotificationSource& source, |
| 1116 const content::NotificationDetails& details) { | 1115 const content::NotificationDetails& details) { |
| 1117 switch (type) { | 1116 switch (type) { |
| 1118 case chrome::NOTIFICATION_EXTENSION_LOADED: { | 1117 case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: { |
| 1119 const Extension* extension = | 1118 const Extension* extension = |
| 1120 content::Details<const Extension>(details).ptr(); | 1119 content::Details<const Extension>(details).ptr(); |
| 1121 if (IsAppPinned(extension->id())) { | 1120 if (IsAppPinned(extension->id())) { |
| 1122 // Clear and re-fetch to ensure icon is up-to-date. | 1121 // Clear and re-fetch to ensure icon is up-to-date. |
| 1123 app_icon_loader_->ClearImage(extension->id()); | 1122 app_icon_loader_->ClearImage(extension->id()); |
| 1124 app_icon_loader_->FetchImage(extension->id()); | 1123 app_icon_loader_->FetchImage(extension->id()); |
| 1125 } | 1124 } |
| 1126 | 1125 |
| 1127 UpdateAppLaunchersFromPref(); | 1126 UpdateAppLaunchersFromPref(); |
| 1128 break; | 1127 break; |
| (...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2000 } | 1999 } |
| 2001 | 2000 |
| 2002 void ChromeLauncherController::ReleaseProfile() { | 2001 void ChromeLauncherController::ReleaseProfile() { |
| 2003 if (app_sync_ui_state_) | 2002 if (app_sync_ui_state_) |
| 2004 app_sync_ui_state_->RemoveObserver(this); | 2003 app_sync_ui_state_->RemoveObserver(this); |
| 2005 | 2004 |
| 2006 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); | 2005 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); |
| 2007 | 2006 |
| 2008 pref_change_registrar_.RemoveAll(); | 2007 pref_change_registrar_.RemoveAll(); |
| 2009 } | 2008 } |
| OLD | NEW |