| 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 "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h" | 35 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h" |
| 36 #include "chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.h" | 36 #include "chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.h" |
| 37 #include "chrome/browser/ui/webui/theme_source.h" | 37 #include "chrome/browser/ui/webui/theme_source.h" |
| 38 #include "chrome/common/chrome_notification_types.h" | 38 #include "chrome/common/chrome_notification_types.h" |
| 39 #include "chrome/common/chrome_switches.h" | 39 #include "chrome/common/chrome_switches.h" |
| 40 #include "chrome/common/extensions/extension.h" | 40 #include "chrome/common/extensions/extension.h" |
| 41 #include "chrome/common/pref_names.h" | 41 #include "chrome/common/pref_names.h" |
| 42 #include "chrome/common/url_constants.h" | 42 #include "chrome/common/url_constants.h" |
| 43 #include "content/browser/renderer_host/render_view_host.h" | 43 #include "content/browser/renderer_host/render_view_host.h" |
| 44 #include "content/browser/tab_contents/tab_contents.h" | 44 #include "content/browser/tab_contents/tab_contents.h" |
| 45 #include "content/browser/user_metrics.h" | |
| 46 #include "content/public/browser/browser_thread.h" | 45 #include "content/public/browser/browser_thread.h" |
| 47 #include "content/public/browser/notification_service.h" | 46 #include "content/public/browser/notification_service.h" |
| 47 #include "content/public/browser/user_metrics.h" |
| 48 #include "grit/generated_resources.h" | 48 #include "grit/generated_resources.h" |
| 49 #include "grit/theme_resources.h" | 49 #include "grit/theme_resources.h" |
| 50 #include "ui/base/l10n/l10n_util.h" | 50 #include "ui/base/l10n/l10n_util.h" |
| 51 | 51 |
| 52 using content::BrowserThread; | 52 using content::BrowserThread; |
| 53 using content::UserMetricsAction; |
| 53 | 54 |
| 54 namespace { | 55 namespace { |
| 55 | 56 |
| 56 // The amount of time there must be no painting for us to consider painting | 57 // The amount of time there must be no painting for us to consider painting |
| 57 // finished. Observed times are in the ~1200ms range on Windows. | 58 // finished. Observed times are in the ~1200ms range on Windows. |
| 58 const int kTimeoutMs = 2000; | 59 const int kTimeoutMs = 2000; |
| 59 | 60 |
| 60 // Strings sent to the page via jstemplates used to set the direction of the | 61 // Strings sent to the page via jstemplates used to set the direction of the |
| 61 // HTML document based on locale. | 62 // HTML document based on locale. |
| 62 const char kRTLHtmlTextDirection[] = "rtl"; | 63 const char kRTLHtmlTextDirection[] = "rtl"; |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 SendResponse(request_id, html_bytes); | 272 SendResponse(request_id, html_bytes); |
| 272 } | 273 } |
| 273 | 274 |
| 274 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { | 275 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { |
| 275 return "text/html"; | 276 return "text/html"; |
| 276 } | 277 } |
| 277 | 278 |
| 278 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { | 279 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { |
| 279 return false; | 280 return false; |
| 280 } | 281 } |
| OLD | NEW |