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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 // DesktopNotificationService. For this reason, instead of showing the | 318 // DesktopNotificationService. For this reason, instead of showing the |
319 // balloon right now, we schedule it to show a little later. | 319 // balloon right now, we schedule it to show a little later. |
320 MessageLoop::current()->PostTask( | 320 MessageLoop::current()->PostTask( |
321 FROM_HERE, base::Bind(&ShowBalloon, extension, profile)); | 321 FROM_HERE, base::Bind(&ShowBalloon, extension, profile)); |
322 break; | 322 break; |
323 } | 323 } |
324 case chrome::NOTIFICATION_EXTENSION_UNLOADED: | 324 case chrome::NOTIFICATION_EXTENSION_UNLOADED: |
325 switch (content::Details<UnloadedExtensionInfo>(details)->reason) { | 325 switch (content::Details<UnloadedExtensionInfo>(details)->reason) { |
326 case extension_misc::UNLOAD_REASON_DISABLE: // Fall through. | 326 case extension_misc::UNLOAD_REASON_DISABLE: // Fall through. |
327 case extension_misc::UNLOAD_REASON_TERMINATE: // Fall through. | 327 case extension_misc::UNLOAD_REASON_TERMINATE: // Fall through. |
328 case extension_misc::UNLOAD_REASON_UNINSTALL: | 328 case extension_misc::UNLOAD_REASON_UNINSTALL: // Fall through. |
| 329 case extension_misc::UNLOAD_REASON_BLACKLIST: |
329 ShutdownAssociatedBackgroundContents( | 330 ShutdownAssociatedBackgroundContents( |
330 ASCIIToUTF16(content::Details<UnloadedExtensionInfo>(details)-> | 331 ASCIIToUTF16(content::Details<UnloadedExtensionInfo>(details)-> |
331 extension->id())); | 332 extension->id())); |
332 SendChangeNotification(content::Source<Profile>(source).ptr()); | 333 SendChangeNotification(content::Source<Profile>(source).ptr()); |
333 break; | 334 break; |
334 case extension_misc::UNLOAD_REASON_UPDATE: { | 335 case extension_misc::UNLOAD_REASON_UPDATE: { |
335 // If there is a manifest specified background page, then shut it down | 336 // If there is a manifest specified background page, then shut it down |
336 // here, since if the updated extension still has the background page, | 337 // here, since if the updated extension still has the background page, |
337 // then it will be loaded from LOADED callback. Otherwise, leave | 338 // then it will be loaded from LOADED callback. Otherwise, leave |
338 // BackgroundContents in place. | 339 // BackgroundContents in place. |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 bool user_gesture, | 625 bool user_gesture, |
625 bool* was_blocked) { | 626 bool* was_blocked) { |
626 Browser* browser = chrome::FindLastActiveWithProfile( | 627 Browser* browser = chrome::FindLastActiveWithProfile( |
627 Profile::FromBrowserContext(new_contents->GetBrowserContext()), | 628 Profile::FromBrowserContext(new_contents->GetBrowserContext()), |
628 chrome::GetActiveDesktop()); | 629 chrome::GetActiveDesktop()); |
629 if (browser) { | 630 if (browser) { |
630 chrome::AddWebContents(browser, NULL, new_contents, disposition, | 631 chrome::AddWebContents(browser, NULL, new_contents, disposition, |
631 initial_pos, user_gesture, was_blocked); | 632 initial_pos, user_gesture, was_blocked); |
632 } | 633 } |
633 } | 634 } |
OLD | NEW |