| 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 18 matching lines...) Expand all Loading... |
| 29 #include "chrome/browser/themes/theme_service.h" | 29 #include "chrome/browser/themes/theme_service.h" |
| 30 #include "chrome/browser/themes/theme_service_factory.h" | 30 #include "chrome/browser/themes/theme_service_factory.h" |
| 31 #include "chrome/browser/ui/browser.h" | 31 #include "chrome/browser/ui/browser.h" |
| 32 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 32 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
| 33 #include "chrome/browser/ui/webui/ntp/favicon_webui_handler.h" | 33 #include "chrome/browser/ui/webui/ntp/favicon_webui_handler.h" |
| 34 #include "chrome/browser/ui/webui/ntp/foreign_session_handler.h" | 34 #include "chrome/browser/ui/webui/ntp/foreign_session_handler.h" |
| 35 #include "chrome/browser/ui/webui/ntp/most_visited_handler.h" | 35 #include "chrome/browser/ui/webui/ntp/most_visited_handler.h" |
| 36 #include "chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h" | 36 #include "chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h" |
| 37 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h" | 37 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h" |
| 38 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h" | 38 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h" |
| 39 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h" |
| 39 #include "chrome/browser/ui/webui/ntp/shown_sections_handler.h" | 40 #include "chrome/browser/ui/webui/ntp/shown_sections_handler.h" |
| 40 #include "chrome/browser/ui/webui/ntp/value_helper.h" | 41 #include "chrome/browser/ui/webui/ntp/value_helper.h" |
| 41 #include "chrome/browser/ui/webui/theme_source.h" | 42 #include "chrome/browser/ui/webui/theme_source.h" |
| 42 #include "chrome/common/chrome_switches.h" | 43 #include "chrome/common/chrome_switches.h" |
| 43 #include "chrome/common/extensions/extension.h" | 44 #include "chrome/common/extensions/extension.h" |
| 44 #include "chrome/common/pref_names.h" | 45 #include "chrome/common/pref_names.h" |
| 45 #include "chrome/common/url_constants.h" | 46 #include "chrome/common/url_constants.h" |
| 46 #include "content/browser/browser_thread.h" | 47 #include "content/browser/browser_thread.h" |
| 47 #include "content/browser/renderer_host/render_view_host.h" | 48 #include "content/browser/renderer_host/render_view_host.h" |
| 48 #include "content/browser/tab_contents/tab_contents.h" | 49 #include "content/browser/tab_contents/tab_contents.h" |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 if (AppLauncherHandler::HandlePing(profile_, path)) { | 656 if (AppLauncherHandler::HandlePing(profile_, path)) { |
| 656 return; | 657 return; |
| 657 } else if (!path.empty() && path[0] != '#') { | 658 } else if (!path.empty() && path[0] != '#') { |
| 658 // A path under new-tab was requested; it's likely a bad relative | 659 // A path under new-tab was requested; it's likely a bad relative |
| 659 // URL from the new tab page, but in any case it's an error. | 660 // URL from the new tab page, but in any case it's an error. |
| 660 NOTREACHED() << path << " should not have been requested on the NTP"; | 661 NOTREACHED() << path << " should not have been requested on the NTP"; |
| 661 return; | 662 return; |
| 662 } | 663 } |
| 663 | 664 |
| 664 scoped_refptr<RefCountedBytes> html_bytes( | 665 scoped_refptr<RefCountedBytes> html_bytes( |
| 665 profile_->GetNTPResourceCache()->GetNewTabHTML(is_incognito)); | 666 NTPResourceCacheFactory::GetForProfile(profile_)-> |
| 667 GetNewTabHTML(is_incognito)); |
| 666 | 668 |
| 667 SendResponse(request_id, html_bytes); | 669 SendResponse(request_id, html_bytes); |
| 668 } | 670 } |
| 669 | 671 |
| 670 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { | 672 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { |
| 671 return "text/html"; | 673 return "text/html"; |
| 672 } | 674 } |
| 673 | 675 |
| 674 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { | 676 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { |
| 675 return false; | 677 return false; |
| 676 } | 678 } |
| OLD | NEW |