OLD | NEW |
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/dom_ui_theme_source.h" | 5 #include "chrome/browser/dom_ui/dom_ui_theme_source.h" |
6 | 6 |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "app/theme_provider.h" | 8 #include "app/theme_provider.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/ref_counted_memory.h" | 10 #include "base/ref_counted_memory.h" |
11 #include "chrome/browser/browser_thread.h" | 11 #include "chrome/browser/browser_thread.h" |
12 #include "chrome/browser/dom_ui/ntp_resource_cache.h" | 12 #include "chrome/browser/dom_ui/ntp_resource_cache.h" |
13 #include "chrome/browser/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/resources_util.h" | 14 #include "chrome/browser/resources_util.h" |
15 #include "chrome/browser/themes/browser_theme_provider.h" | 15 #include "chrome/browser/themes/browser_theme_provider.h" |
16 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
18 | 18 |
19 // use a resource map rather than hard-coded strings. | 19 // use a resource map rather than hard-coded strings. |
20 static const char* kNewTabCSSPath = "css/newtab.css"; | 20 static const char* kNewTabCSSPath = "css/newtab.css"; |
21 static const char* kNewIncognitoTabCSSPath = "css/newincognitotab.css"; | 21 static const char* kNewIncognitoTabCSSPath = "css/newincognitotab.css"; |
22 | 22 |
23 static std::string StripQueryParams(const std::string& path) { | 23 static std::string StripQueryParams(const std::string& path) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 DCHECK(tp); | 104 DCHECK(tp); |
105 | 105 |
106 scoped_refptr<RefCountedMemory> image_data(tp->GetRawData(resource_id)); | 106 scoped_refptr<RefCountedMemory> image_data(tp->GetRawData(resource_id)); |
107 SendResponse(request_id, image_data); | 107 SendResponse(request_id, image_data); |
108 } else { | 108 } else { |
109 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 109 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
110 const ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 110 const ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
111 SendResponse(request_id, rb.LoadDataResourceBytes(resource_id)); | 111 SendResponse(request_id, rb.LoadDataResourceBytes(resource_id)); |
112 } | 112 } |
113 } | 113 } |
OLD | NEW |