Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Side by Side Diff: chrome/browser/extensions/extension_function_dispatcher.cc

Issue 6461024: Revert 74292 - Splits ChromeURLDataManager into 2 chunks:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/dom_ui/textfields_ui.cc ('k') | chrome/browser/extensions/extensions_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/singleton.h" 10 #include "base/singleton.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 // Notify the ExtensionProcessManager that the view was created. 384 // Notify the ExtensionProcessManager that the view was created.
385 ExtensionProcessManager* epm = profile()->GetExtensionProcessManager(); 385 ExtensionProcessManager* epm = profile()->GetExtensionProcessManager();
386 epm->RegisterExtensionProcess(extension_id(), 386 epm->RegisterExtensionProcess(extension_id(),
387 render_view_host->process()->id()); 387 render_view_host->process()->id());
388 388
389 // If the extension has permission to load chrome://favicon/ resources we need 389 // If the extension has permission to load chrome://favicon/ resources we need
390 // to make sure that the WebUIFavIconSource is registered with the 390 // to make sure that the WebUIFavIconSource is registered with the
391 // ChromeURLDataManager. 391 // ChromeURLDataManager.
392 if (extension->HasHostPermission(GURL(chrome::kChromeUIFavIconURL))) { 392 if (extension->HasHostPermission(GURL(chrome::kChromeUIFavIconURL))) {
393 WebUIFavIconSource* favicon_source = new WebUIFavIconSource(profile_); 393 WebUIFavIconSource* favicon_source = new WebUIFavIconSource(profile_);
394 profile_->GetChromeURLDataManager()->AddDataSource(favicon_source); 394 BrowserThread::PostTask(
395 BrowserThread::IO, FROM_HERE,
396 NewRunnableMethod(ChromeURLDataManager::GetInstance(),
397 &ChromeURLDataManager::AddDataSource,
398 make_scoped_refptr(favicon_source)));
395 } 399 }
396 400
397 // Update the extension permissions. Doing this each time we create an EFD 401 // Update the extension permissions. Doing this each time we create an EFD
398 // ensures that new processes are informed of permissions for newly installed 402 // ensures that new processes are informed of permissions for newly installed
399 // extensions. 403 // extensions.
400 render_view_host->Send(new ViewMsg_Extension_SetAPIPermissions( 404 render_view_host->Send(new ViewMsg_Extension_SetAPIPermissions(
401 extension->id(), extension->api_permissions())); 405 extension->id(), extension->api_permissions()));
402 render_view_host->Send(new ViewMsg_Extension_SetHostPermissions( 406 render_view_host->Send(new ViewMsg_Extension_SetHostPermissions(
403 extension->url(), extension->host_permissions())); 407 extension->url(), extension->host_permissions()));
404 408
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 NOTREACHED(); 501 NOTREACHED();
498 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_EFD")); 502 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_EFD"));
499 base::KillProcess(render_view_host_->process()->GetHandle(), 503 base::KillProcess(render_view_host_->process()->GetHandle(),
500 ResultCodes::KILLED_BAD_MESSAGE, false); 504 ResultCodes::KILLED_BAD_MESSAGE, false);
501 } 505 }
502 } 506 }
503 507
504 Profile* ExtensionFunctionDispatcher::profile() { 508 Profile* ExtensionFunctionDispatcher::profile() {
505 return profile_; 509 return profile_;
506 } 510 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/textfields_ui.cc ('k') | chrome/browser/extensions/extensions_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698