| 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 17 matching lines...) Expand all Loading... |
| 28 const char kCommonCSSPath[] = "/common.css"; | 28 const char kCommonCSSPath[] = "/common.css"; |
| 29 | 29 |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| 32 MostVisitedIframeSource::MostVisitedIframeSource() { | 32 MostVisitedIframeSource::MostVisitedIframeSource() { |
| 33 } | 33 } |
| 34 | 34 |
| 35 MostVisitedIframeSource::~MostVisitedIframeSource() { | 35 MostVisitedIframeSource::~MostVisitedIframeSource() { |
| 36 } | 36 } |
| 37 | 37 |
| 38 const int MostVisitedIframeSource::kNumMostVisited = 8; | |
| 39 const char MostVisitedIframeSource::kMostVisitedHistogramName[] = | |
| 40 "NewTabPage.MostVisited"; | |
| 41 | |
| 42 std::string MostVisitedIframeSource::GetSource() const { | 38 std::string MostVisitedIframeSource::GetSource() const { |
| 43 return chrome::kChromeSearchMostVisitedHost; | 39 return chrome::kChromeSearchMostVisitedHost; |
| 44 } | 40 } |
| 45 | 41 |
| 46 void MostVisitedIframeSource::StartDataRequest( | 42 void MostVisitedIframeSource::StartDataRequest( |
| 47 const std::string& path_and_query, | 43 const std::string& path_and_query, |
| 48 int render_process_id, | 44 int render_process_id, |
| 49 int render_frame_id, | 45 int render_frame_id, |
| 50 const content::URLDataSource::GotDataCallback& callback) { | 46 const content::URLDataSource::GotDataCallback& callback) { |
| 51 GURL url(chrome::kChromeSearchMostVisitedUrl + path_and_query); | 47 GURL url(chrome::kChromeSearchMostVisitedUrl + path_and_query); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 80 } | 76 } |
| 81 } | 77 } |
| 82 | 78 |
| 83 bool MostVisitedIframeSource::ServesPath(const std::string& path) const { | 79 bool MostVisitedIframeSource::ServesPath(const std::string& path) const { |
| 84 return path == kTitleHTMLPath || path == kTitleCSSPath || | 80 return path == kTitleHTMLPath || path == kTitleCSSPath || |
| 85 path == kTitleJSPath || path == kThumbnailHTMLPath || | 81 path == kTitleJSPath || path == kThumbnailHTMLPath || |
| 86 path == kThumbnailCSSPath || path == kThumbnailJSPath || | 82 path == kThumbnailCSSPath || path == kThumbnailJSPath || |
| 87 path == kSingleHTMLPath || path == kSingleCSSPath || | 83 path == kSingleHTMLPath || path == kSingleCSSPath || |
| 88 path == kSingleJSPath || path == kUtilJSPath || path == kCommonCSSPath; | 84 path == kSingleJSPath || path == kUtilJSPath || path == kCommonCSSPath; |
| 89 } | 85 } |
| OLD | NEW |