| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/ntp/new_tab_ui.h" | 5 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "chrome/browser/chrome_notification_types.h" | 15 #include "chrome/browser/chrome_notification_types.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/ui/host_desktop.h" |
| 17 #include "chrome/browser/ui/webui/metrics_handler.h" | 18 #include "chrome/browser/ui/webui/metrics_handler.h" |
| 18 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 19 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
| 19 #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h" | 20 #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h" |
| 20 #include "chrome/browser/ui/webui/ntp/favicon_webui_handler.h" | 21 #include "chrome/browser/ui/webui/ntp/favicon_webui_handler.h" |
| 21 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" | 22 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" |
| 22 #include "chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h" | 23 #include "chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h" |
| 23 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h" | 24 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h" |
| 24 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h" | 25 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h" |
| 25 #include "chrome/browser/ui/webui/ntp/ntp_user_data_logger.h" | 26 #include "chrome/browser/ui/webui/ntp/ntp_user_data_logger.h" |
| 26 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 37 #include "extensions/browser/extension_system.h" | 38 #include "extensions/browser/extension_system.h" |
| 38 #include "grit/browser_resources.h" | 39 #include "grit/browser_resources.h" |
| 39 #include "ui/base/l10n/l10n_util.h" | 40 #include "ui/base/l10n/l10n_util.h" |
| 40 #include "ui/base/resource/resource_bundle.h" | 41 #include "ui/base/resource/resource_bundle.h" |
| 41 | 42 |
| 42 #if defined(ENABLE_THEMES) | 43 #if defined(ENABLE_THEMES) |
| 43 #include "chrome/browser/ui/webui/theme_handler.h" | 44 #include "chrome/browser/ui/webui/theme_handler.h" |
| 44 #endif | 45 #endif |
| 45 | 46 |
| 46 #if defined(USE_ASH) | 47 #if defined(USE_ASH) |
| 47 #include "chrome/browser/ui/host_desktop.h" | 48 #include "ui/gfx/host_desktop_type.h" |
| 48 #endif | 49 #endif |
| 49 | 50 |
| 50 using content::BrowserThread; | 51 using content::BrowserThread; |
| 51 using content::RenderViewHost; | 52 using content::RenderViewHost; |
| 52 using content::WebUIController; | 53 using content::WebUIController; |
| 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. |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, | 341 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, |
| 341 const char* mime_type, | 342 const char* mime_type, |
| 342 int resource_id) { | 343 int resource_id) { |
| 343 DCHECK(resource); | 344 DCHECK(resource); |
| 344 DCHECK(mime_type); | 345 DCHECK(mime_type); |
| 345 resource_map_[std::string(resource)] = | 346 resource_map_[std::string(resource)] = |
| 346 std::make_pair(std::string(mime_type), resource_id); | 347 std::make_pair(std::string(mime_type), resource_id); |
| 347 } | 348 } |
| 348 | 349 |
| 349 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} | 350 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} |
| OLD | NEW |