OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/search/local_ntp_source.h" | 5 #include "chrome/browser/search/local_ntp_source.h" |
6 | 6 |
7 #include "base/json/json_string_value_serializer.h" | 7 #include "base/json/json_string_value_serializer.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 const char kConfigDataFilename[] = "config.js"; | 36 const char kConfigDataFilename[] = "config.js"; |
37 | 37 |
38 const struct Resource{ | 38 const struct Resource{ |
39 const char* filename; | 39 const char* filename; |
40 int identifier; | 40 int identifier; |
41 const char* mime_type; | 41 const char* mime_type; |
42 } kResources[] = { | 42 } kResources[] = { |
43 { "local-ntp.html", IDR_LOCAL_NTP_HTML, "text/html" }, | 43 { "local-ntp.html", IDR_LOCAL_NTP_HTML, "text/html" }, |
44 { "local-ntp.js", IDR_LOCAL_NTP_JS, "application/javascript" }, | 44 { "local-ntp.js", IDR_LOCAL_NTP_JS, "application/javascript" }, |
| 45 { "local-ntp-util.js", IDR_LOCAL_NTP_UTIL_JS, "application/javascript" }, |
45 { kConfigDataFilename, kLocalResource, "application/javascript" }, | 46 { kConfigDataFilename, kLocalResource, "application/javascript" }, |
46 { "local-ntp.css", IDR_LOCAL_NTP_CSS, "text/css" }, | 47 { "local-ntp.css", IDR_LOCAL_NTP_CSS, "text/css" }, |
47 { "images/close_2.png", IDR_CLOSE_2, "image/png" }, | 48 { "images/close_2.png", IDR_CLOSE_2, "image/png" }, |
48 { "images/close_2_hover.png", IDR_CLOSE_2_H, "image/png" }, | 49 { "images/close_2_hover.png", IDR_CLOSE_2_H, "image/png" }, |
49 { "images/close_2_active.png", IDR_CLOSE_2_P, "image/png" }, | 50 { "images/close_2_active.png", IDR_CLOSE_2_P, "image/png" }, |
50 { "images/close_2_white.png", IDR_CLOSE_2_MASK, "image/png" }, | 51 { "images/close_2_white.png", IDR_CLOSE_2_MASK, "image/png" }, |
51 { "images/google_logo.png", IDR_LOCAL_NTP_IMAGES_LOGO_PNG, "image/png" }, | 52 { "images/google_logo.png", IDR_LOCAL_NTP_IMAGES_LOGO_PNG, "image/png" }, |
52 { "images/white_google_logo.png", | 53 { "images/white_google_logo.png", |
53 IDR_LOCAL_NTP_IMAGES_WHITE_LOGO_PNG, "image/png" }, | 54 IDR_LOCAL_NTP_IMAGES_WHITE_LOGO_PNG, "image/png" }, |
54 }; | 55 }; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 193 } |
193 } | 194 } |
194 return false; | 195 return false; |
195 } | 196 } |
196 | 197 |
197 std::string LocalNtpSource::GetContentSecurityPolicyFrameSrc() const { | 198 std::string LocalNtpSource::GetContentSecurityPolicyFrameSrc() const { |
198 // Allow embedding of most visited iframes. | 199 // Allow embedding of most visited iframes. |
199 return base::StringPrintf("frame-src %s;", | 200 return base::StringPrintf("frame-src %s;", |
200 chrome::kChromeSearchMostVisitedUrl); | 201 chrome::kChromeSearchMostVisitedUrl); |
201 } | 202 } |
OLD | NEW |