OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 7 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 | 511 |
512 if (AppLauncherHandler::HandlePing(profile_, path)) { | 512 if (AppLauncherHandler::HandlePing(profile_, path)) { |
513 return; | 513 return; |
514 } else if (!path.empty() && path[0] != '#') { | 514 } else if (!path.empty() && path[0] != '#') { |
515 // A path under new-tab was requested; it's likely a bad relative | 515 // A path under new-tab was requested; it's likely a bad relative |
516 // URL from the new tab page, but in any case it's an error. | 516 // URL from the new tab page, but in any case it's an error. |
517 NOTREACHED() << path << " should not have been requested on the NTP"; | 517 NOTREACHED() << path << " should not have been requested on the NTP"; |
518 return; | 518 return; |
519 } | 519 } |
520 | 520 |
521 scoped_refptr<RefCountedBytes> html_bytes( | 521 scoped_refptr<RefCountedMemory> html_bytes( |
522 NTPResourceCacheFactory::GetForProfile(profile_)-> | 522 NTPResourceCacheFactory::GetForProfile(profile_)-> |
523 GetNewTabHTML(is_incognito)); | 523 GetNewTabHTML(is_incognito)); |
524 | 524 |
525 SendResponse(request_id, html_bytes); | 525 SendResponse(request_id, html_bytes); |
526 } | 526 } |
527 | 527 |
528 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { | 528 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { |
529 return "text/html"; | 529 return "text/html"; |
530 } | 530 } |
531 | 531 |
532 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { | 532 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { |
533 return false; | 533 return false; |
534 } | 534 } |
OLD | NEW |