| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/extension_host.h" | 5 #include "extensions/browser/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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 OnDecrementLazyKeepaliveCount) | 346 OnDecrementLazyKeepaliveCount) |
| 347 IPC_MESSAGE_UNHANDLED(handled = false) | 347 IPC_MESSAGE_UNHANDLED(handled = false) |
| 348 IPC_END_MESSAGE_MAP() | 348 IPC_END_MESSAGE_MAP() |
| 349 return handled; | 349 return handled; |
| 350 } | 350 } |
| 351 | 351 |
| 352 void ExtensionHost::OnRequest(const ExtensionHostMsg_Request_Params& params) { | 352 void ExtensionHost::OnRequest(const ExtensionHostMsg_Request_Params& params) { |
| 353 extension_function_dispatcher_.Dispatch(params, render_view_host()); | 353 extension_function_dispatcher_.Dispatch(params, render_view_host()); |
| 354 } | 354 } |
| 355 | 355 |
| 356 void ExtensionHost::OnEventAck() { | 356 void ExtensionHost::OnEventAck(int message_id) { |
| 357 EventRouter* router = EventRouter::Get(browser_context_); | 357 EventRouter* router = EventRouter::Get(browser_context_); |
| 358 if (router) | 358 if (router) |
| 359 router->OnEventAck(browser_context_, extension_id()); | 359 router->OnEventAck(browser_context_, extension_id()); |
| 360 |
| 361 content::NotificationService::current()->Notify( |
| 362 NOTIFICATION_EXTENSION_MESSAGE_ACKED, |
| 363 content::Source<content::BrowserContext>(browser_context_), |
| 364 content::Details<int>(&message_id)); |
| 360 } | 365 } |
| 361 | 366 |
| 362 void ExtensionHost::OnIncrementLazyKeepaliveCount() { | 367 void ExtensionHost::OnIncrementLazyKeepaliveCount() { |
| 363 ProcessManager::Get(browser_context_) | 368 ProcessManager::Get(browser_context_) |
| 364 ->IncrementLazyKeepaliveCount(extension()); | 369 ->IncrementLazyKeepaliveCount(extension()); |
| 365 } | 370 } |
| 366 | 371 |
| 367 void ExtensionHost::OnDecrementLazyKeepaliveCount() { | 372 void ExtensionHost::OnDecrementLazyKeepaliveCount() { |
| 368 ProcessManager::Get(browser_context_) | 373 ProcessManager::Get(browser_context_) |
| 369 ->DecrementLazyKeepaliveCount(extension()); | 374 ->DecrementLazyKeepaliveCount(extension()); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 return delegate_->CheckMediaAccessPermission( | 448 return delegate_->CheckMediaAccessPermission( |
| 444 web_contents, security_origin, type, extension()); | 449 web_contents, security_origin, type, extension()); |
| 445 } | 450 } |
| 446 | 451 |
| 447 bool ExtensionHost::IsNeverVisible(content::WebContents* web_contents) { | 452 bool ExtensionHost::IsNeverVisible(content::WebContents* web_contents) { |
| 448 ViewType view_type = extensions::GetViewType(web_contents); | 453 ViewType view_type = extensions::GetViewType(web_contents); |
| 449 return view_type == extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE; | 454 return view_type == extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE; |
| 450 } | 455 } |
| 451 | 456 |
| 452 } // namespace extensions | 457 } // namespace extensions |
| OLD | NEW |