Index: chrome/browser/search/local_ntp_source.cc |
diff --git a/chrome/browser/search/local_ntp_source.cc b/chrome/browser/search/local_ntp_source.cc |
index 38cbd7a2e2e5dad40a4098a53bd482dc6fd9b1e5..127e2e12f088e85811c10de99e4c4f7dacf8c593 100644 |
--- a/chrome/browser/search/local_ntp_source.cc |
+++ b/chrome/browser/search/local_ntp_source.cc |
@@ -10,9 +10,11 @@ |
#include "chrome/common/url_constants.h" |
#include "googleurl/src/gurl.h" |
#include "grit/browser_resources.h" |
+#include "grit/theme_resources.h" |
#include "grit/ui_resources.h" |
#include "net/url_request/url_request.h" |
#include "ui/base/resource/resource_bundle.h" |
+#include "ui/base/theme_provider.h" |
namespace { |
@@ -22,6 +24,13 @@ const char kCssFilename[] = "local-ntp.css"; |
const char kCloseBarFilename[] = "images/close_2.png"; |
const char kCloseBarHoverFilename[] = "images/close_2_hover.png"; |
const char kCloseBarActiveFilename[] = "images/close_2_active.png"; |
+const char kPageIconFilename[] = "images/page_icon.png"; |
+const char kPageIcon2xFilename[] = "images/2x/page_icon.png"; |
+const char kSearchIconFilename[] = "images/search_icon.png"; |
+const char kSearchIcon2xFilename[] = "images/2x/search_icon.png"; |
+// TODO(jeremycho): Add 2x images. |
+const char kGoogleLogoFilename[] = "images/google_logo.png"; |
+const char kWhiteGoogleLogoFilename[] = "images/white_google_logo.png"; |
} // namespace |
@@ -52,6 +61,18 @@ void LocalNtpSource::StartDataRequest( |
identifier = IDR_CLOSE_2_H; |
} else if (path == kCloseBarActiveFilename) { |
identifier = IDR_CLOSE_2_P; |
+ } else if (path == kPageIconFilename) { |
+ identifier = IDR_LOCAL_OMNIBOX_POPUP_IMAGES_PAGE_ICON_PNG; |
+ } else if (path == kPageIcon2xFilename) { |
+ identifier = IDR_LOCAL_OMNIBOX_POPUP_IMAGES_2X_PAGE_ICON_PNG; |
+ } else if (path == kSearchIconFilename) { |
+ identifier = IDR_LOCAL_OMNIBOX_POPUP_IMAGES_SEARCH_ICON_PNG; |
+ } else if (path == kSearchIcon2xFilename) { |
+ identifier = IDR_LOCAL_OMNIBOX_POPUP_IMAGES_2X_SEARCH_ICON_PNG; |
+ } else if (path == kGoogleLogoFilename) { |
+ identifier = IDR_NEWTAB_GOOGLE_LOGO; |
+ } else if (path == kWhiteGoogleLogoFilename) { |
+ identifier = IDR_NEWTAB_WHITE_GOOGLE_LOGO; |
} else { |
callback.Run(NULL); |
return; |
@@ -71,7 +92,10 @@ std::string LocalNtpSource::GetMimeType( |
if (path == kCssFilename) |
return "text/css"; |
if (path == kCloseBarFilename || path == kCloseBarHoverFilename || |
- path == kCloseBarActiveFilename) { |
+ path == kCloseBarActiveFilename || path == kPageIconFilename || |
+ path == kPageIcon2xFilename || path == kSearchIconFilename || |
+ path == kSearchIcon2xFilename || path == kGoogleLogoFilename || |
+ path == kWhiteGoogleLogoFilename) { |
return "image/png"; |
} |
return std::string(); |
@@ -87,7 +111,12 @@ bool LocalNtpSource::ShouldServiceRequest( |
return filename == kHtmlFilename || filename == kJSFilename || |
filename == kCssFilename || filename == kCloseBarFilename || |
filename == kCloseBarHoverFilename || |
- filename == kCloseBarActiveFilename; |
+ filename == kCloseBarActiveFilename || |
+ filename == kPageIconFilename || filename == kPageIcon2xFilename || |
+ filename == kSearchIconFilename || |
+ filename == kSearchIcon2xFilename || |
+ filename == kGoogleLogoFilename || |
+ filename == kWhiteGoogleLogoFilename; |
samarth
2013/04/15 19:01:34
This was fine when we had a couple of files but it
jeremycho
2013/04/16 01:42:37
Done.
|
} |
return false; |
} |