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

Side by Side Diff: chrome/browser/dom_ui/shared_resources_data_source.cc

Issue 2101019: Print Preview component extension (Closed)
Patch Set: Put it under a flag Created 10 years, 5 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
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/profile.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 "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "base/singleton.h" 8 #include "base/singleton.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/chrome_thread.h" 10 #include "chrome/browser/chrome_thread.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 : DataSource(chrome::kChromeUIResourcesHost, NULL) { 66 : DataSource(chrome::kChromeUIResourcesHost, NULL) {
67 } 67 }
68 68
69 SharedResourcesDataSource::~SharedResourcesDataSource() { 69 SharedResourcesDataSource::~SharedResourcesDataSource() {
70 } 70 }
71 71
72 void SharedResourcesDataSource::StartDataRequest(const std::string& path, 72 void SharedResourcesDataSource::StartDataRequest(const std::string& path,
73 bool is_off_the_record, 73 bool is_off_the_record,
74 int request_id) { 74 int request_id) {
75 int idr = PathToIDR(path); 75 int idr = PathToIDR(path);
76 DCHECK_NE(-1, idr); 76 DCHECK_NE(-1, idr) << "Couldn't find shared resource: " << path;
77 const ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 77 const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
78 scoped_refptr<RefCountedStaticMemory> bytes(rb.LoadDataResourceBytes(idr)); 78 scoped_refptr<RefCountedStaticMemory> bytes(rb.LoadDataResourceBytes(idr));
79 SendResponse(request_id, bytes); 79 SendResponse(request_id, bytes);
80 } 80 }
81 81
82 std::string SharedResourcesDataSource::GetMimeType( 82 std::string SharedResourcesDataSource::GetMimeType(
83 const std::string& path) const { 83 const std::string& path) const {
84 std::string mime_type; 84 std::string mime_type;
85 net::GetMimeTypeFromFile(FilePath().AppendASCII(path), &mime_type); 85 net::GetMimeTypeFromFile(FilePath().AppendASCII(path), &mime_type);
86 return mime_type; 86 return mime_type;
87 } 87 }
88 88
OLDNEW
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698