| 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/extensions/extension_function_dispatcher.h" | 5 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 epm->RegisterExtensionProcess(extension_id(), | 380 epm->RegisterExtensionProcess(extension_id(), |
| 381 render_view_host->process()->id()); | 381 render_view_host->process()->id()); |
| 382 | 382 |
| 383 // If the extension has permission to load chrome://favicon/ resources we need | 383 // If the extension has permission to load chrome://favicon/ resources we need |
| 384 // to make sure that the DOMUIFavIconSource is registered with the | 384 // to make sure that the DOMUIFavIconSource is registered with the |
| 385 // ChromeURLDataManager. | 385 // ChromeURLDataManager. |
| 386 if (extension->HasHostPermission(GURL(chrome::kChromeUIFavIconURL))) { | 386 if (extension->HasHostPermission(GURL(chrome::kChromeUIFavIconURL))) { |
| 387 DOMUIFavIconSource* favicon_source = new DOMUIFavIconSource(profile_); | 387 DOMUIFavIconSource* favicon_source = new DOMUIFavIconSource(profile_); |
| 388 BrowserThread::PostTask( | 388 BrowserThread::PostTask( |
| 389 BrowserThread::IO, FROM_HERE, | 389 BrowserThread::IO, FROM_HERE, |
| 390 NewRunnableMethod(Singleton<ChromeURLDataManager>::get(), | 390 NewRunnableMethod(ChromeURLDataManager::GetInstance(), |
| 391 &ChromeURLDataManager::AddDataSource, | 391 &ChromeURLDataManager::AddDataSource, |
| 392 make_scoped_refptr(favicon_source))); | 392 make_scoped_refptr(favicon_source))); |
| 393 } | 393 } |
| 394 | 394 |
| 395 // Update the extension permissions. Doing this each time we create an EFD | 395 // Update the extension permissions. Doing this each time we create an EFD |
| 396 // ensures that new processes are informed of permissions for newly installed | 396 // ensures that new processes are informed of permissions for newly installed |
| 397 // extensions. | 397 // extensions. |
| 398 render_view_host->Send(new ViewMsg_Extension_SetAPIPermissions( | 398 render_view_host->Send(new ViewMsg_Extension_SetAPIPermissions( |
| 399 extension->id(), extension->api_permissions())); | 399 extension->id(), extension->api_permissions())); |
| 400 render_view_host->Send(new ViewMsg_Extension_SetHostPermissions( | 400 render_view_host->Send(new ViewMsg_Extension_SetHostPermissions( |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 } else { | 494 } else { |
| 495 NOTREACHED(); | 495 NOTREACHED(); |
| 496 base::KillProcess(render_view_host_->process()->GetHandle(), | 496 base::KillProcess(render_view_host_->process()->GetHandle(), |
| 497 ResultCodes::KILLED_BAD_MESSAGE, false); | 497 ResultCodes::KILLED_BAD_MESSAGE, false); |
| 498 } | 498 } |
| 499 } | 499 } |
| 500 | 500 |
| 501 Profile* ExtensionFunctionDispatcher::profile() { | 501 Profile* ExtensionFunctionDispatcher::profile() { |
| 502 return profile_; | 502 return profile_; |
| 503 } | 503 } |
| OLD | NEW |