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

Side by Side Diff: content/browser/webui/shared_resources_data_source.cc

Issue 23726024: Fix 2x UI issues for Feedback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « no previous file | ui/webui/resources/css/apps/common.css » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/webui/shared_resources_data_source.h" 5 #include "content/browser/webui/shared_resources_data_source.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 17 matching lines...) Expand all
28 // path to ui/resources instead. 28 // path to ui/resources instead.
29 // TODO(rkc): Once we have a separate source for apps, remove this code. 29 // TODO(rkc): Once we have a separate source for apps, remove this code.
30 bool AppsRelativePathMatch(const std::string& path, 30 bool AppsRelativePathMatch(const std::string& path,
31 const std::string& compareto) { 31 const std::string& compareto) {
32 if (StartsWithASCII(path, kAppImagesPath, false)) { 32 if (StartsWithASCII(path, kAppImagesPath, false)) {
33 if (compareto == 33 if (compareto ==
34 (kReplacement + path.substr(arraysize(kAppImagesPath) - 1))) 34 (kReplacement + path.substr(arraysize(kAppImagesPath) - 1)))
35 return true; 35 return true;
36 } else if (StartsWithASCII(path, kAppImagesPath2x, false)) { 36 } else if (StartsWithASCII(path, kAppImagesPath2x, false)) {
37 if (compareto == 37 if (compareto ==
38 (kReplacement2x + path.substr(arraysize(kAppImagesPath) - 1))) 38 (kReplacement2x + path.substr(arraysize(kAppImagesPath2x) - 1)))
39 return true; 39 return true;
40 } 40 }
41 return false; 41 return false;
42 } 42 }
43 43
44 int PathToIDR(const std::string& path) { 44 int PathToIDR(const std::string& path) {
45 int idr = -1; 45 int idr = -1;
46 for (size_t i = 0; i < kWebuiResourcesSize; ++i) { 46 for (size_t i = 0; i < kWebuiResourcesSize; ++i) {
47 if ((path == kWebuiResources[i].name) || 47 if ((path == kWebuiResources[i].name) ||
48 AppsRelativePathMatch(path, kWebuiResources[i].name)) { 48 AppsRelativePathMatch(path, kWebuiResources[i].name)) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 std::string SharedResourcesDataSource::GetMimeType( 82 std::string SharedResourcesDataSource::GetMimeType(
83 const std::string& path) const { 83 const std::string& path) const {
84 // Requests should not block on the disk! On POSIX this goes to disk. 84 // Requests should not block on the disk! On POSIX this goes to disk.
85 // http://code.google.com/p/chromium/issues/detail?id=59849 85 // http://code.google.com/p/chromium/issues/detail?id=59849
86 86
87 base::ThreadRestrictions::ScopedAllowIO allow_io; 87 base::ThreadRestrictions::ScopedAllowIO allow_io;
88 std::string mime_type; 88 std::string mime_type;
89 net::GetMimeTypeFromFile(base::FilePath().AppendASCII(path), &mime_type); 89 net::GetMimeTypeFromFile(base::FilePath().AppendASCII(path), &mime_type);
90 return mime_type; 90 return mime_type;
91 } 91 }
OLDNEW
« no previous file with comments | « no previous file | ui/webui/resources/css/apps/common.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698