| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browsing_history_handler.h" | 5 #include "chrome/browser/ui/webui/browsing_history_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 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/favicon_source.h" | 35 #include "chrome/browser/ui/webui/favicon_source.h" |
| 36 #include "chrome/browser/ui/webui/large_icon_source.h" | 36 #include "chrome/browser/ui/webui/large_icon_source.h" |
| 37 #include "chrome/common/features.h" | 37 #include "chrome/common/features.h" |
| 38 #include "chrome/common/pref_names.h" | 38 #include "chrome/common/pref_names.h" |
| 39 #include "components/bookmarks/browser/bookmark_model.h" | 39 #include "components/bookmarks/browser/bookmark_model.h" |
| 40 #include "components/bookmarks/browser/bookmark_utils.h" | 40 #include "components/bookmarks/browser/bookmark_utils.h" |
| 41 #include "components/browser_sync/profile_sync_service.h" | 41 #include "components/browser_sync/profile_sync_service.h" |
| 42 #include "components/browsing_data_ui/history_notice_utils.h" | 42 #include "components/browsing_data/core/history_notice_utils.h" |
| 43 #include "components/favicon/core/fallback_icon_service.h" | 43 #include "components/favicon/core/fallback_icon_service.h" |
| 44 #include "components/favicon/core/fallback_url_util.h" | 44 #include "components/favicon/core/fallback_url_util.h" |
| 45 #include "components/favicon/core/large_icon_service.h" | 45 #include "components/favicon/core/large_icon_service.h" |
| 46 #include "components/history/core/browser/history_service.h" | 46 #include "components/history/core/browser/history_service.h" |
| 47 #include "components/history/core/browser/history_types.h" | 47 #include "components/history/core/browser/history_types.h" |
| 48 #include "components/history/core/browser/web_history_service.h" | 48 #include "components/history/core/browser/web_history_service.h" |
| 49 #include "components/keyed_service/core/service_access_type.h" | 49 #include "components/keyed_service/core/service_access_type.h" |
| 50 #include "components/prefs/pref_service.h" | 50 #include "components/prefs/pref_service.h" |
| 51 #include "components/query_parser/snippet.h" | 51 #include "components/query_parser/snippet.h" |
| 52 #include "components/strings/grit/components_strings.h" | 52 #include "components/strings/grit/components_strings.h" |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 base::Bind(&BrowsingHistoryHandler::WebHistoryQueryComplete, | 465 base::Bind(&BrowsingHistoryHandler::WebHistoryQueryComplete, |
| 466 base::Unretained(this), | 466 base::Unretained(this), |
| 467 search_text, options, | 467 search_text, options, |
| 468 base::TimeTicks::Now())); | 468 base::TimeTicks::Now())); |
| 469 // Start a timer so we know when to give up. | 469 // Start a timer so we know when to give up. |
| 470 web_history_timer_.Start( | 470 web_history_timer_.Start( |
| 471 FROM_HERE, base::TimeDelta::FromSeconds(kWebHistoryTimeoutSeconds), | 471 FROM_HERE, base::TimeDelta::FromSeconds(kWebHistoryTimeoutSeconds), |
| 472 this, &BrowsingHistoryHandler::WebHistoryTimeout); | 472 this, &BrowsingHistoryHandler::WebHistoryTimeout); |
| 473 | 473 |
| 474 // Test the existence of other forms of browsing history. | 474 // Test the existence of other forms of browsing history. |
| 475 browsing_data_ui::ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( | 475 browsing_data::ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( |
| 476 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile), | 476 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile), |
| 477 web_history, | 477 web_history, |
| 478 base::Bind( | 478 base::Bind( |
| 479 &BrowsingHistoryHandler::OtherFormsOfBrowsingHistoryQueryComplete, | 479 &BrowsingHistoryHandler::OtherFormsOfBrowsingHistoryQueryComplete, |
| 480 weak_factory_.GetWeakPtr())); | 480 weak_factory_.GetWeakPtr())); |
| 481 } else { | 481 } else { |
| 482 // The notice could not have been shown, because there is no web history. | 482 // The notice could not have been shown, because there is no web history. |
| 483 RecordMetricsForNoticeAboutOtherFormsOfBrowsingHistory(false); | 483 RecordMetricsForNoticeAboutOtherFormsOfBrowsingHistory(false); |
| 484 } | 484 } |
| 485 } | 485 } |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 bool expired, | 1004 bool expired, |
| 1005 const history::URLRows& deleted_rows, | 1005 const history::URLRows& deleted_rows, |
| 1006 const std::set<GURL>& favicon_urls) { | 1006 const std::set<GURL>& favicon_urls) { |
| 1007 if (all_history || DeletionsDiffer(deleted_rows, urls_to_be_deleted_)) | 1007 if (all_history || DeletionsDiffer(deleted_rows, urls_to_be_deleted_)) |
| 1008 web_ui()->CallJavascriptFunctionUnsafe("historyDeleted"); | 1008 web_ui()->CallJavascriptFunctionUnsafe("historyDeleted"); |
| 1009 } | 1009 } |
| 1010 | 1010 |
| 1011 void BrowsingHistoryHandler::OnWebHistoryDeleted() { | 1011 void BrowsingHistoryHandler::OnWebHistoryDeleted() { |
| 1012 web_ui()->CallJavascriptFunctionUnsafe("historyDeleted"); | 1012 web_ui()->CallJavascriptFunctionUnsafe("historyDeleted"); |
| 1013 } | 1013 } |
| OLD | NEW |