Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_contents_service.h" | 5 #include "chrome/browser/background_contents_service.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 case NotificationType::BACKGROUND_CONTENTS_CLOSED: | 108 case NotificationType::BACKGROUND_CONTENTS_CLOSED: |
| 109 DCHECK(IsTracked(Details<BackgroundContents>(details).ptr())); | 109 DCHECK(IsTracked(Details<BackgroundContents>(details).ptr())); |
| 110 UnregisterBackgroundContents(Details<BackgroundContents>(details).ptr()); | 110 UnregisterBackgroundContents(Details<BackgroundContents>(details).ptr()); |
| 111 break; | 111 break; |
| 112 case NotificationType::BACKGROUND_CONTENTS_NAVIGATED: | 112 case NotificationType::BACKGROUND_CONTENTS_NAVIGATED: |
| 113 DCHECK(IsTracked(Details<BackgroundContents>(details).ptr())); | 113 DCHECK(IsTracked(Details<BackgroundContents>(details).ptr())); |
| 114 RegisterBackgroundContents(Details<BackgroundContents>(details).ptr()); | 114 RegisterBackgroundContents(Details<BackgroundContents>(details).ptr()); |
| 115 break; | 115 break; |
| 116 case NotificationType::EXTENSION_UNLOADED: | 116 case NotificationType::EXTENSION_UNLOADED: |
| 117 ShutdownAssociatedBackgroundContents( | 117 ShutdownAssociatedBackgroundContents( |
| 118 ASCIIToUTF16(Details<const Extension>(details)->id())); | 118 ASCIIToUTF16( |
| 119 Details<UnloadedExtensionInfo>(details)->extension->id())); | |
|
Erik does not do reviews
2010/12/23 17:05:17
extension can be NULL right? more reason why we s
asargent_no_longer_on_chrome
2010/12/23 18:53:04
It turns out it can't.
| |
| 119 break; | 120 break; |
| 120 default: | 121 default: |
| 121 NOTREACHED(); | 122 NOTREACHED(); |
| 122 break; | 123 break; |
| 123 } | 124 } |
| 124 } | 125 } |
| 125 | 126 |
| 126 // Loads all background contents whose urls have been stored in prefs. | 127 // Loads all background contents whose urls have been stored in prefs. |
| 127 void BackgroundContentsService::LoadBackgroundContentsFromPrefs( | 128 void BackgroundContentsService::LoadBackgroundContentsFromPrefs( |
| 128 Profile* profile) { | 129 Profile* profile) { |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 307 TabContents* new_contents, | 308 TabContents* new_contents, |
| 308 WindowOpenDisposition disposition, | 309 WindowOpenDisposition disposition, |
| 309 const gfx::Rect& initial_pos, | 310 const gfx::Rect& initial_pos, |
| 310 bool user_gesture) { | 311 bool user_gesture) { |
| 311 Browser* browser = BrowserList::GetLastActiveWithProfile( | 312 Browser* browser = BrowserList::GetLastActiveWithProfile( |
| 312 new_contents->profile()); | 313 new_contents->profile()); |
| 313 if (!browser) | 314 if (!browser) |
| 314 return; | 315 return; |
| 315 browser->AddTabContents(new_contents, disposition, initial_pos, user_gesture); | 316 browser->AddTabContents(new_contents, disposition, initial_pos, user_gesture); |
| 316 } | 317 } |
| OLD | NEW |