| 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/instant_service.h" | 5 #include "chrome/browser/search/instant_service.h" |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "chrome/browser/history/history_notifications.h" | 8 #include "chrome/browser/history/history_notifications.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/search/instant_io_context.h" | 10 #include "chrome/browser/search/instant_io_context.h" |
| 11 #include "chrome/browser/search/instant_service_factory.h" | 11 #include "chrome/browser/search/instant_service_factory.h" |
| 12 #include "chrome/browser/search/local_ntp_source.h" |
| 12 #include "chrome/browser/search/local_omnibox_popup_source.h" | 13 #include "chrome/browser/search/local_omnibox_popup_source.h" |
| 13 #include "chrome/browser/ui/webui/favicon_source.h" | 14 #include "chrome/browser/ui/webui/favicon_source.h" |
| 14 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" | 15 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" |
| 15 #include "chrome/browser/ui/webui/theme_source.h" | 16 #include "chrome/browser/ui/webui/theme_source.h" |
| 16 #include "chrome/common/chrome_notification_types.h" | 17 #include "chrome/common/chrome_notification_types.h" |
| 17 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 18 #include "content/public/browser/notification_service.h" | 19 #include "content/public/browser/notification_service.h" |
| 19 #include "content/public/browser/notification_types.h" | 20 #include "content/public/browser/notification_types.h" |
| 20 #include "content/public/browser/render_process_host.h" | 21 #include "content/public/browser/render_process_host.h" |
| 21 #include "content/public/browser/url_data_source.h" | 22 #include "content/public/browser/url_data_source.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 45 } | 46 } |
| 46 | 47 |
| 47 // Set up the data sources that Instant uses on the NTP. | 48 // Set up the data sources that Instant uses on the NTP. |
| 48 #if defined(ENABLE_THEMES) | 49 #if defined(ENABLE_THEMES) |
| 49 content::URLDataSource::Add(profile, new ThemeSource(profile)); | 50 content::URLDataSource::Add(profile, new ThemeSource(profile)); |
| 50 #endif | 51 #endif |
| 51 content::URLDataSource::Add(profile, new ThumbnailSource(profile)); | 52 content::URLDataSource::Add(profile, new ThumbnailSource(profile)); |
| 52 content::URLDataSource::Add(profile, new FaviconSource( | 53 content::URLDataSource::Add(profile, new FaviconSource( |
| 53 profile, FaviconSource::FAVICON)); | 54 profile, FaviconSource::FAVICON)); |
| 54 content::URLDataSource::Add(profile, new LocalOmniboxPopupSource()); | 55 content::URLDataSource::Add(profile, new LocalOmniboxPopupSource()); |
| 56 content::URLDataSource::Add(profile, new LocalNtpSource()); |
| 55 } | 57 } |
| 56 | 58 |
| 57 InstantService::~InstantService() { | 59 InstantService::~InstantService() { |
| 58 } | 60 } |
| 59 | 61 |
| 60 // static | 62 // static |
| 61 const std::string InstantService::MaybeTranslateInstantPathOnUI( | 63 const std::string InstantService::MaybeTranslateInstantPathOnUI( |
| 62 Profile* profile, const std::string& path) { | 64 Profile* profile, const std::string& path) { |
| 63 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 65 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 64 InstantService* instant_service = | 66 InstantService* instant_service = |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 BrowserThread::IO, FROM_HERE, | 174 BrowserThread::IO, FROM_HERE, |
| 173 base::Bind(&InstantIOContext::RemoveInstantProcessOnIO, | 175 base::Bind(&InstantIOContext::RemoveInstantProcessOnIO, |
| 174 instant_io_context_, process_id)); | 176 instant_io_context_, process_id)); |
| 175 } | 177 } |
| 176 break; | 178 break; |
| 177 } | 179 } |
| 178 default: | 180 default: |
| 179 NOTREACHED() << "Unexpected notification type in InstantService."; | 181 NOTREACHED() << "Unexpected notification type in InstantService."; |
| 180 } | 182 } |
| 181 } | 183 } |
| OLD | NEW |