OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ref_counted.h" | 10 #include "base/ref_counted.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 394 |
395 // Notify the ExtensionProcessManager that the view was created. | 395 // Notify the ExtensionProcessManager that the view was created. |
396 ExtensionProcessManager* epm = profile()->GetExtensionProcessManager(); | 396 ExtensionProcessManager* epm = profile()->GetExtensionProcessManager(); |
397 epm->RegisterExtensionProcess(extension_id(), | 397 epm->RegisterExtensionProcess(extension_id(), |
398 render_view_host->process()->id()); | 398 render_view_host->process()->id()); |
399 | 399 |
400 // If the extension has permission to load chrome://favicon/ resources we need | 400 // If the extension has permission to load chrome://favicon/ resources we need |
401 // to make sure that the FaviconSource is registered with the | 401 // to make sure that the FaviconSource is registered with the |
402 // ChromeURLDataManager. | 402 // ChromeURLDataManager. |
403 if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) { | 403 if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) { |
404 FaviconSource* favicon_source = new FaviconSource(profile_); | 404 FaviconSource* favicon_source = new FaviconSource(profile_, |
| 405 chrome::kChromeUIFaviconURL); |
405 profile_->GetChromeURLDataManager()->AddDataSource(favicon_source); | 406 profile_->GetChromeURLDataManager()->AddDataSource(favicon_source); |
406 } | 407 } |
407 | 408 |
408 // Update the extension permissions. Doing this each time we create an EFD | 409 // Update the extension permissions. Doing this each time we create an EFD |
409 // ensures that new processes are informed of permissions for newly installed | 410 // ensures that new processes are informed of permissions for newly installed |
410 // extensions. | 411 // extensions. |
411 render_view_host->Send(new ViewMsg_Extension_SetAPIPermissions( | 412 render_view_host->Send(new ViewMsg_Extension_SetAPIPermissions( |
412 extension->id(), extension->api_permissions())); | 413 extension->id(), extension->api_permissions())); |
413 render_view_host->Send(new ViewMsg_Extension_SetHostPermissions( | 414 render_view_host->Send(new ViewMsg_Extension_SetHostPermissions( |
414 extension->url(), extension->host_permissions())); | 415 extension->url(), extension->host_permissions())); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 NOTREACHED(); | 509 NOTREACHED(); |
509 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_EFD")); | 510 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_EFD")); |
510 base::KillProcess(render_view_host_->process()->GetHandle(), | 511 base::KillProcess(render_view_host_->process()->GetHandle(), |
511 ResultCodes::KILLED_BAD_MESSAGE, false); | 512 ResultCodes::KILLED_BAD_MESSAGE, false); |
512 } | 513 } |
513 } | 514 } |
514 | 515 |
515 Profile* ExtensionFunctionDispatcher::profile() { | 516 Profile* ExtensionFunctionDispatcher::profile() { |
516 return profile_; | 517 return profile_; |
517 } | 518 } |
OLD | NEW |