Chromium Code Reviews| 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/history_ui.h" | 5 #include "chrome/browser/ui/webui/history_ui.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 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 14 matching lines...) Expand all Loading... | |
| 25 #include "chrome/browser/history/history_notifications.h" | 25 #include "chrome/browser/history/history_notifications.h" |
| 26 #include "chrome/browser/history/history_service_factory.h" | 26 #include "chrome/browser/history/history_service_factory.h" |
| 27 #include "chrome/browser/history/web_history_service.h" | 27 #include "chrome/browser/history/web_history_service.h" |
| 28 #include "chrome/browser/history/web_history_service_factory.h" | 28 #include "chrome/browser/history/web_history_service_factory.h" |
| 29 #include "chrome/browser/profiles/profile.h" | 29 #include "chrome/browser/profiles/profile.h" |
| 30 #include "chrome/browser/signin/signin_manager_factory.h" | 30 #include "chrome/browser/signin/signin_manager_factory.h" |
| 31 #include "chrome/browser/sync/profile_sync_service.h" | 31 #include "chrome/browser/sync/profile_sync_service.h" |
| 32 #include "chrome/browser/sync/profile_sync_service_factory.h" | 32 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 33 #include "chrome/browser/ui/browser_finder.h" | 33 #include "chrome/browser/ui/browser_finder.h" |
| 34 #include "chrome/browser/ui/chrome_pages.h" | 34 #include "chrome/browser/ui/chrome_pages.h" |
| 35 #include "chrome/browser/ui/webui/fallback_icon_source.h" | |
| 35 #include "chrome/browser/ui/webui/favicon_source.h" | 36 #include "chrome/browser/ui/webui/favicon_source.h" |
| 36 #include "chrome/browser/ui/webui/metrics_handler.h" | 37 #include "chrome/browser/ui/webui/metrics_handler.h" |
| 37 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
| 38 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
| 39 #include "chrome/common/url_constants.h" | 40 #include "chrome/common/url_constants.h" |
| 40 #include "chrome/grit/generated_resources.h" | 41 #include "chrome/grit/generated_resources.h" |
| 41 #include "components/bookmarks/browser/bookmark_model.h" | 42 #include "components/bookmarks/browser/bookmark_model.h" |
| 42 #include "components/bookmarks/browser/bookmark_utils.h" | 43 #include "components/bookmarks/browser/bookmark_utils.h" |
| 43 #include "components/history/core/browser/history_types.h" | 44 #include "components/history/core/browser/history_types.h" |
| 44 #include "components/search/search.h" | 45 #include "components/search/search.h" |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 421 } | 422 } |
| 422 | 423 |
| 423 BrowsingHistoryHandler::~BrowsingHistoryHandler() { | 424 BrowsingHistoryHandler::~BrowsingHistoryHandler() { |
| 424 query_task_tracker_.TryCancelAll(); | 425 query_task_tracker_.TryCancelAll(); |
| 425 web_history_request_.reset(); | 426 web_history_request_.reset(); |
| 426 } | 427 } |
| 427 | 428 |
| 428 void BrowsingHistoryHandler::RegisterMessages() { | 429 void BrowsingHistoryHandler::RegisterMessages() { |
| 429 // Create our favicon data source. | 430 // Create our favicon data source. |
| 430 Profile* profile = Profile::FromWebUI(web_ui()); | 431 Profile* profile = Profile::FromWebUI(web_ui()); |
| 432 content::URLDataSource::Add(profile, new FallbackIconSource()); | |
|
pkotwicz
2015/01/21 19:44:15
Remove this. The history page does not use fallbac
huangs
2015/01/22 01:13:27
Done.
| |
| 431 content::URLDataSource::Add( | 433 content::URLDataSource::Add( |
| 432 profile, new FaviconSource(profile, FaviconSource::ANY)); | 434 profile, new FaviconSource(profile, FaviconSource::ANY)); |
| 433 | 435 |
| 434 // Get notifications when history is cleared. | 436 // Get notifications when history is cleared. |
| 435 registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URLS_DELETED, | 437 registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URLS_DELETED, |
| 436 content::Source<Profile>(profile->GetOriginalProfile())); | 438 content::Source<Profile>(profile->GetOriginalProfile())); |
| 437 | 439 |
| 438 web_ui()->RegisterMessageCallback("queryHistory", | 440 web_ui()->RegisterMessageCallback("queryHistory", |
| 439 base::Bind(&BrowsingHistoryHandler::HandleQueryHistory, | 441 base::Bind(&BrowsingHistoryHandler::HandleQueryHistory, |
| 440 base::Unretained(this))); | 442 base::Unretained(this))); |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1036 Profile* profile = Profile::FromWebUI(web_ui); | 1038 Profile* profile = Profile::FromWebUI(web_ui); |
| 1037 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); | 1039 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); |
| 1038 } | 1040 } |
| 1039 | 1041 |
| 1040 // static | 1042 // static |
| 1041 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( | 1043 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( |
| 1042 ui::ScaleFactor scale_factor) { | 1044 ui::ScaleFactor scale_factor) { |
| 1043 return ResourceBundle::GetSharedInstance(). | 1045 return ResourceBundle::GetSharedInstance(). |
| 1044 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); | 1046 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); |
| 1045 } | 1047 } |
| OLD | NEW |