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/extensions/extension_host.h" | 5 #include "chrome/browser/extensions/extension_host.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // popup, for example). When the first ExtensionHost goes away, the extension | 299 // popup, for example). When the first ExtensionHost goes away, the extension |
300 // is unloaded, and any other host that pointed to that extension will have | 300 // is unloaded, and any other host that pointed to that extension will have |
301 // its pointer to it NULLed out so that any attempt to unload a dirty pointer | 301 // its pointer to it NULLed out so that any attempt to unload a dirty pointer |
302 // will be averted. | 302 // will be averted. |
303 if (!extension_) | 303 if (!extension_) |
304 return; | 304 return; |
305 | 305 |
306 // TODO(aa): This is suspicious. There can be multiple views in an extension, | 306 // TODO(aa): This is suspicious. There can be multiple views in an extension, |
307 // and they aren't all going to use ExtensionHost. This should be in someplace | 307 // and they aren't all going to use ExtensionHost. This should be in someplace |
308 // more central, like EPM maybe. | 308 // more central, like EPM maybe. |
| 309 // TODO(aa): Change this name to EXTENSION_HOST_DESTROYED and put a TODO to |
| 310 // stop using it. |
309 content::NotificationService::current()->Notify( | 311 content::NotificationService::current()->Notify( |
310 chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, | 312 chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, |
311 content::Source<Profile>(profile_), | 313 content::Source<Profile>(profile_), |
312 content::Details<ExtensionHost>(this)); | 314 content::Details<ExtensionHost>(this)); |
313 } | 315 } |
314 | 316 |
315 void ExtensionHost::InsertInfobarCSS() { | 317 void ExtensionHost::InsertInfobarCSS() { |
316 DCHECK(!is_background_page()); | 318 DCHECK(!is_background_page()); |
317 | 319 |
318 static const base::StringPiece css( | 320 static const base::StringPiece css( |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 browser::Navigate(¶ms); | 570 browser::Navigate(¶ms); |
569 } | 571 } |
570 | 572 |
571 | 573 |
572 void ExtensionHost::RenderViewReady() { | 574 void ExtensionHost::RenderViewReady() { |
573 content::NotificationService::current()->Notify( | 575 content::NotificationService::current()->Notify( |
574 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, | 576 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, |
575 content::Source<Profile>(profile_), | 577 content::Source<Profile>(profile_), |
576 content::Details<ExtensionHost>(this)); | 578 content::Details<ExtensionHost>(this)); |
577 } | 579 } |
OLD | NEW |