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

Side by Side Diff: chrome/browser/dom_ui/shared_resources_data_source.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/remoting_ui.cc ('k') | chrome/browser/dom_ui/slideshow_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/dom_ui/shared_resources_data_source.h" 5 #include "chrome/browser/dom_ui/shared_resources_data_source.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "base/singleton.h" 10 #include "base/singleton.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 51
52 } // namespace 52 } // namespace
53 53
54 // static 54 // static
55 void SharedResourcesDataSource::Register() { 55 void SharedResourcesDataSource::Register() {
56 SharedResourcesDataSource* source = new SharedResourcesDataSource(); 56 SharedResourcesDataSource* source = new SharedResourcesDataSource();
57 BrowserThread::PostTask( 57 BrowserThread::PostTask(
58 BrowserThread::IO, FROM_HERE, 58 BrowserThread::IO, FROM_HERE,
59 NewRunnableMethod( 59 NewRunnableMethod(
60 Singleton<ChromeURLDataManager>::get(), 60 ChromeURLDataManager::GetInstance(),
61 &ChromeURLDataManager::AddDataSource, 61 &ChromeURLDataManager::AddDataSource,
62 make_scoped_refptr(source))); 62 make_scoped_refptr(source)));
63 } 63 }
64 64
65 SharedResourcesDataSource::SharedResourcesDataSource() 65 SharedResourcesDataSource::SharedResourcesDataSource()
66 : DataSource(chrome::kChromeUIResourcesHost, NULL) { 66 : DataSource(chrome::kChromeUIResourcesHost, NULL) {
67 } 67 }
68 68
69 SharedResourcesDataSource::~SharedResourcesDataSource() { 69 SharedResourcesDataSource::~SharedResourcesDataSource() {
70 } 70 }
(...skipping 12 matching lines...) Expand all
83 const std::string& path) const { 83 const std::string& path) const {
84 // Requests should not block on the disk! On Windows this goes to the 84 // Requests should not block on the disk! On Windows this goes to the
85 // registry. 85 // registry.
86 // http://code.google.com/p/chromium/issues/detail?id=59849 86 // http://code.google.com/p/chromium/issues/detail?id=59849
87 base::ThreadRestrictions::ScopedAllowIO allow_io; 87 base::ThreadRestrictions::ScopedAllowIO allow_io;
88 88
89 std::string mime_type; 89 std::string mime_type;
90 net::GetMimeTypeFromFile(FilePath().AppendASCII(path), &mime_type); 90 net::GetMimeTypeFromFile(FilePath().AppendASCII(path), &mime_type);
91 return mime_type; 91 return mime_type;
92 } 92 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/remoting_ui.cc ('k') | chrome/browser/dom_ui/slideshow_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698