| 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/most_visited_iframe_source.h" | 5 #include "chrome/browser/search/most_visited_iframe_source.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } else if (path == kTitleJSPath) { | 54 } else if (path == kTitleJSPath) { |
| 55 SendResource(IDR_MOST_VISITED_TITLE_JS, callback); | 55 SendResource(IDR_MOST_VISITED_TITLE_JS, callback); |
| 56 } else if (path == kThumbnailHTMLPath) { | 56 } else if (path == kThumbnailHTMLPath) { |
| 57 SendResource(IDR_MOST_VISITED_THUMBNAIL_HTML, callback); | 57 SendResource(IDR_MOST_VISITED_THUMBNAIL_HTML, callback); |
| 58 } else if (path == kThumbnailCSSPath) { | 58 } else if (path == kThumbnailCSSPath) { |
| 59 SendResource(IDR_MOST_VISITED_THUMBNAIL_CSS, callback); | 59 SendResource(IDR_MOST_VISITED_THUMBNAIL_CSS, callback); |
| 60 } else if (path == kThumbnailJSPath) { | 60 } else if (path == kThumbnailJSPath) { |
| 61 SendJSWithOrigin(IDR_MOST_VISITED_THUMBNAIL_JS, render_process_id, | 61 SendJSWithOrigin(IDR_MOST_VISITED_THUMBNAIL_JS, render_process_id, |
| 62 render_frame_id, callback); | 62 render_frame_id, callback); |
| 63 } else if (path == kUtilJSPath) { | 63 } else if (path == kUtilJSPath) { |
| 64 SendResource(IDR_MOST_VISITED_UTIL_JS, callback); | 64 SendJSWithOrigin(IDR_MOST_VISITED_UTIL_JS, render_process_id, |
| 65 render_frame_id, callback); |
| 65 } else if (path == kCommonCSSPath) { | 66 } else if (path == kCommonCSSPath) { |
| 66 SendResource(IDR_MOST_VISITED_IFRAME_CSS, callback); | 67 SendResource(IDR_MOST_VISITED_IFRAME_CSS, callback); |
| 67 } else { | 68 } else { |
| 68 callback.Run(NULL); | 69 callback.Run(NULL); |
| 69 } | 70 } |
| 70 } | 71 } |
| 71 | 72 |
| 72 bool MostVisitedIframeSource::ServesPath(const std::string& path) const { | 73 bool MostVisitedIframeSource::ServesPath(const std::string& path) const { |
| 73 return path == kTitleHTMLPath || path == kTitleCSSPath || | 74 return path == kTitleHTMLPath || path == kTitleCSSPath || |
| 74 path == kTitleJSPath || path == kThumbnailHTMLPath || | 75 path == kTitleJSPath || path == kThumbnailHTMLPath || |
| 75 path == kThumbnailCSSPath || path == kThumbnailJSPath || | 76 path == kThumbnailCSSPath || path == kThumbnailJSPath || |
| 76 path == kUtilJSPath || path == kCommonCSSPath; | 77 path == kUtilJSPath || path == kCommonCSSPath; |
| 77 } | 78 } |
| OLD | NEW |