| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 68 |
| 68 // Set up the data sources that Instant uses on the NTP. | 69 // Set up the data sources that Instant uses on the NTP. |
| 69 #if defined(ENABLE_THEMES) | 70 #if defined(ENABLE_THEMES) |
| 70 content::URLDataSource::Add(profile, new ThemeSource(profile)); | 71 content::URLDataSource::Add(profile, new ThemeSource(profile)); |
| 71 #endif | 72 #endif |
| 72 content::URLDataSource::Add(profile, new ThumbnailSource(profile)); | 73 content::URLDataSource::Add(profile, new ThumbnailSource(profile)); |
| 73 content::URLDataSource::Add(profile, new FaviconSource( | 74 content::URLDataSource::Add(profile, new FaviconSource( |
| 74 profile, FaviconSource::FAVICON)); | 75 profile, FaviconSource::FAVICON)); |
| 75 */ | 76 */ |
| 76 content::URLDataSource::Add(profile, new LocalOmniboxPopupSource()); | 77 content::URLDataSource::Add(profile, new LocalOmniboxPopupSource()); |
| 78 content::URLDataSource::Add(profile, new LocalNTPSource()); |
| 77 } | 79 } |
| 78 | 80 |
| 79 InstantService::~InstantService() { | 81 InstantService::~InstantService() { |
| 80 } | 82 } |
| 81 | 83 |
| 82 // static | 84 // static |
| 83 const std::string InstantService::MaybeTranslateInstantPathOnUI( | 85 const std::string InstantService::MaybeTranslateInstantPathOnUI( |
| 84 Profile* profile, const std::string& path) { | 86 Profile* profile, const std::string& path) { |
| 85 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 86 InstantService* instant_service = | 88 InstantService* instant_service = |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 url_to_most_visited_item_id_map_.find(*it); | 246 url_to_most_visited_item_id_map_.find(*it); |
| 245 if (item != url_to_most_visited_item_id_map_.end()) { | 247 if (item != url_to_most_visited_item_id_map_.end()) { |
| 246 uint64 most_visited_item_id = item->second; | 248 uint64 most_visited_item_id = item->second; |
| 247 url_to_most_visited_item_id_map_.erase(item); | 249 url_to_most_visited_item_id_map_.erase(item); |
| 248 most_visited_item_id_to_url_map_.erase( | 250 most_visited_item_id_to_url_map_.erase( |
| 249 most_visited_item_id_to_url_map_.find(most_visited_item_id)); | 251 most_visited_item_id_to_url_map_.find(most_visited_item_id)); |
| 250 deleted_ids->push_back(most_visited_item_id); | 252 deleted_ids->push_back(most_visited_item_id); |
| 251 } | 253 } |
| 252 } | 254 } |
| 253 } | 255 } |
| OLD | NEW |