| OLD | NEW |
| 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 "chrome/browser/ui/webui/shared_resources_data_source.h" | 5 #include "chrome/browser/ui/webui/shared_resources_data_source.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| 11 #include "base/threading/thread_restrictions.h" | 11 #include "base/threading/thread_restrictions.h" |
| 12 #include "chrome/browser/io_thread.h" | 12 #include "chrome/browser/io_thread.h" |
| 13 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 13 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 14 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
| 15 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
| 16 #include "grit/shared_resources.h" | 16 #include "grit/shared_resources.h" |
| 17 #include "grit/shared_resources_map.h" | 17 #include "grit/shared_resources_map.h" |
| 18 #include "grit/theme_resources.h" | 18 #include "grit/theme_resources.h" |
| 19 #include "grit/ui_resources.h" | 19 #include "grit/ui_resources.h" |
| 20 #include "grit/ui_resources_standard.h" | |
| 21 #include "net/base/mime_util.h" | 20 #include "net/base/mime_util.h" |
| 22 #include "ui/base/layout.h" | 21 #include "ui/base/layout.h" |
| 23 #include "ui/base/resource/resource_bundle.h" | 22 #include "ui/base/resource/resource_bundle.h" |
| 24 | 23 |
| 25 namespace { | 24 namespace { |
| 26 | 25 |
| 27 int PathToIDR(const std::string& path) { | 26 int PathToIDR(const std::string& path) { |
| 28 // The name of the files in the grd list are prefixed with the following | 27 // The name of the files in the grd list are prefixed with the following |
| 29 // directory: | 28 // directory: |
| 30 std::string key("shared/"); | 29 std::string key("shared/"); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 const std::string& path) const { | 65 const std::string& path) const { |
| 67 // Requests should not block on the disk! On Windows this goes to the | 66 // Requests should not block on the disk! On Windows this goes to the |
| 68 // registry. | 67 // registry. |
| 69 // http://code.google.com/p/chromium/issues/detail?id=59849 | 68 // http://code.google.com/p/chromium/issues/detail?id=59849 |
| 70 base::ThreadRestrictions::ScopedAllowIO allow_io; | 69 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 71 | 70 |
| 72 std::string mime_type; | 71 std::string mime_type; |
| 73 net::GetMimeTypeFromFile(FilePath().AppendASCII(path), &mime_type); | 72 net::GetMimeTypeFromFile(FilePath().AppendASCII(path), &mime_type); |
| 74 return mime_type; | 73 return mime_type; |
| 75 } | 74 } |
| OLD | NEW |