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

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

Issue 5519016: Add a new GetInstance() method for singleton classes used in chrome/browser files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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) 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
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
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 }
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