| Index: extensions/browser/extension_web_contents_observer.cc
|
| diff --git a/extensions/browser/extension_web_contents_observer.cc b/extensions/browser/extension_web_contents_observer.cc
|
| index fbfb5a5c5ab1daa06ba98dffd5ddb8f44c47a05e..665fc0809cca1b3ebcfa428ae79d762d9c8c5caa 100644
|
| --- a/extensions/browser/extension_web_contents_observer.cc
|
| +++ b/extensions/browser/extension_web_contents_observer.cc
|
| @@ -20,6 +20,7 @@
|
| #include "extensions/common/constants.h"
|
| #include "extensions/common/extension.h"
|
| #include "extensions/common/extension_messages.h"
|
| +#include "extensions/common/view_type.h"
|
|
|
| namespace extensions {
|
|
|
| @@ -122,19 +123,25 @@ bool ExtensionWebContentsObserver::OnMessageReceived(
|
| }
|
|
|
| void ExtensionWebContentsObserver::PepperInstanceCreated() {
|
| - ProcessManager* const process_manager = ProcessManager::Get(browser_context_);
|
| - const Extension* const extension =
|
| - process_manager->GetExtensionForWebContents(web_contents());
|
| - if (extension)
|
| - process_manager->IncrementLazyKeepaliveCount(extension);
|
| + if (GetViewType(web_contents()) == VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) {
|
| + ProcessManager* const process_manager =
|
| + ProcessManager::Get(browser_context_);
|
| + const Extension* const extension =
|
| + process_manager->GetExtensionForWebContents(web_contents());
|
| + if (extension)
|
| + process_manager->IncrementLazyKeepaliveCount(extension);
|
| + }
|
| }
|
|
|
| void ExtensionWebContentsObserver::PepperInstanceDeleted() {
|
| - ProcessManager* const process_manager = ProcessManager::Get(browser_context_);
|
| - const Extension* const extension =
|
| - process_manager->GetExtensionForWebContents(web_contents());
|
| - if (extension)
|
| - process_manager->DecrementLazyKeepaliveCount(extension);
|
| + if (GetViewType(web_contents()) == VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) {
|
| + ProcessManager* const process_manager =
|
| + ProcessManager::Get(browser_context_);
|
| + const Extension* const extension =
|
| + process_manager->GetExtensionForWebContents(web_contents());
|
| + if (extension)
|
| + process_manager->DecrementLazyKeepaliveCount(extension);
|
| + }
|
| }
|
|
|
| std::string ExtensionWebContentsObserver::GetExtensionIdFromFrame(
|
|
|