| OLD | NEW |
| 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/background/background_contents_service.h" | 5 #include "chrome/browser/background/background_contents_service.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 // DesktopNotificationService. For this reason, instead of showing the | 313 // DesktopNotificationService. For this reason, instead of showing the |
| 314 // balloon right now, we schedule it to show a little later. | 314 // balloon right now, we schedule it to show a little later. |
| 315 MessageLoop::current()->PostTask( | 315 MessageLoop::current()->PostTask( |
| 316 FROM_HERE, base::Bind(&ShowBalloon, extension, profile)); | 316 FROM_HERE, base::Bind(&ShowBalloon, extension, profile)); |
| 317 break; | 317 break; |
| 318 } | 318 } |
| 319 case chrome::NOTIFICATION_EXTENSION_UNLOADED: | 319 case chrome::NOTIFICATION_EXTENSION_UNLOADED: |
| 320 switch (content::Details<UnloadedExtensionInfo>(details)->reason) { | 320 switch (content::Details<UnloadedExtensionInfo>(details)->reason) { |
| 321 case extension_misc::UNLOAD_REASON_DISABLE: // Fall through. | 321 case extension_misc::UNLOAD_REASON_DISABLE: // Fall through. |
| 322 case extension_misc::UNLOAD_REASON_TERMINATE: // Fall through. | 322 case extension_misc::UNLOAD_REASON_TERMINATE: // Fall through. |
| 323 case extension_misc::UNLOAD_REASON_UNINSTALL: | 323 case extension_misc::UNLOAD_REASON_UNINSTALL: // Fall through. |
| 324 case extension_misc::UNLOAD_REASON_BLACKLIST: |
| 324 ShutdownAssociatedBackgroundContents( | 325 ShutdownAssociatedBackgroundContents( |
| 325 ASCIIToUTF16(content::Details<UnloadedExtensionInfo>(details)-> | 326 ASCIIToUTF16(content::Details<UnloadedExtensionInfo>(details)-> |
| 326 extension->id())); | 327 extension->id())); |
| 327 SendChangeNotification(content::Source<Profile>(source).ptr()); | 328 SendChangeNotification(content::Source<Profile>(source).ptr()); |
| 328 break; | 329 break; |
| 329 case extension_misc::UNLOAD_REASON_UPDATE: { | 330 case extension_misc::UNLOAD_REASON_UPDATE: { |
| 330 // If there is a manifest specified background page, then shut it down | 331 // If there is a manifest specified background page, then shut it down |
| 331 // here, since if the updated extension still has the background page, | 332 // here, since if the updated extension still has the background page, |
| 332 // then it will be loaded from LOADED callback. Otherwise, leave | 333 // then it will be loaded from LOADED callback. Otherwise, leave |
| 333 // BackgroundContents in place. | 334 // BackgroundContents in place. |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 bool user_gesture, | 617 bool user_gesture, |
| 617 bool* was_blocked) { | 618 bool* was_blocked) { |
| 618 Browser* browser = chrome::FindLastActiveWithProfile( | 619 Browser* browser = chrome::FindLastActiveWithProfile( |
| 619 Profile::FromBrowserContext(new_contents->GetBrowserContext()), | 620 Profile::FromBrowserContext(new_contents->GetBrowserContext()), |
| 620 chrome::GetActiveDesktop()); | 621 chrome::GetActiveDesktop()); |
| 621 if (browser) { | 622 if (browser) { |
| 622 chrome::AddWebContents(browser, NULL, new_contents, disposition, | 623 chrome::AddWebContents(browser, NULL, new_contents, disposition, |
| 623 initial_pos, user_gesture, was_blocked); | 624 initial_pos, user_gesture, was_blocked); |
| 624 } | 625 } |
| 625 } | 626 } |
| OLD | NEW |