| 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 <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 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 21 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 22 #include "chrome/browser/engagement/site_engagement_service.h" | 22 #include "chrome/browser/engagement/site_engagement_service.h" |
| 23 #include "chrome/browser/history/history_service_factory.h" | 23 #include "chrome/browser/history/history_service_factory.h" |
| 24 #include "chrome/browser/history/history_utils.h" | 24 #include "chrome/browser/history/history_utils.h" |
| 25 #include "chrome/browser/history/web_history_service_factory.h" | 25 #include "chrome/browser/history/web_history_service_factory.h" |
| 26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 27 #include "chrome/browser/sync/profile_sync_service_factory.h" | 27 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 28 #include "chrome/browser/ui/browser_finder.h" | 28 #include "chrome/browser/ui/browser_finder.h" |
| 29 #include "chrome/browser/ui/chrome_pages.h" | 29 #include "chrome/browser/ui/chrome_pages.h" |
| 30 #include "chrome/browser/ui/webui/favicon_source.h" | 30 #include "chrome/browser/ui/webui/favicon_source.h" |
| 31 #include "chrome/common/features.h" |
| 31 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" |
| 32 #include "chrome/grit/generated_resources.h" | 33 #include "chrome/grit/generated_resources.h" |
| 33 #include "components/bookmarks/browser/bookmark_model.h" | 34 #include "components/bookmarks/browser/bookmark_model.h" |
| 34 #include "components/bookmarks/browser/bookmark_utils.h" | 35 #include "components/bookmarks/browser/bookmark_utils.h" |
| 35 #include "components/browser_sync/browser/profile_sync_service.h" | 36 #include "components/browser_sync/browser/profile_sync_service.h" |
| 36 #include "components/history/core/browser/history_service.h" | 37 #include "components/history/core/browser/history_service.h" |
| 37 #include "components/history/core/browser/history_types.h" | 38 #include "components/history/core/browser/history_types.h" |
| 38 #include "components/history/core/browser/web_history_service.h" | 39 #include "components/history/core/browser/web_history_service.h" |
| 39 #include "components/keyed_service/core/service_access_type.h" | 40 #include "components/keyed_service/core/service_access_type.h" |
| 40 #include "components/query_parser/snippet.h" | 41 #include "components/query_parser/snippet.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 52 #include "chrome/browser/extensions/activity_log/activity_log.h" | 53 #include "chrome/browser/extensions/activity_log/activity_log.h" |
| 53 #endif | 54 #endif |
| 54 | 55 |
| 55 #if defined(ENABLE_SUPERVISED_USERS) | 56 #if defined(ENABLE_SUPERVISED_USERS) |
| 56 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h" | 57 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h" |
| 57 #include "chrome/browser/supervised_user/supervised_user_service.h" | 58 #include "chrome/browser/supervised_user/supervised_user_service.h" |
| 58 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | 59 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
| 59 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" | 60 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" |
| 60 #endif | 61 #endif |
| 61 | 62 |
| 62 #if defined(OS_ANDROID) | 63 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 63 #include "chrome/browser/android/chrome_application.h" | 64 #include "chrome/browser/android/chrome_application.h" |
| 64 #endif | 65 #endif |
| 65 | 66 |
| 66 // The amount of time to wait for a response from the WebHistoryService. | 67 // The amount of time to wait for a response from the WebHistoryService. |
| 67 static const int kWebHistoryTimeoutSeconds = 3; | 68 static const int kWebHistoryTimeoutSeconds = 3; |
| 68 | 69 |
| 69 using bookmarks::BookmarkModel; | 70 using bookmarks::BookmarkModel; |
| 70 | 71 |
| 71 namespace { | 72 namespace { |
| 72 | 73 |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 activity_log->RemoveURLs(it->urls); | 538 activity_log->RemoveURLs(it->urls); |
| 538 } | 539 } |
| 539 #endif | 540 #endif |
| 540 | 541 |
| 541 for (const history::ExpireHistoryArgs& expire_entry : expire_list) | 542 for (const history::ExpireHistoryArgs& expire_entry : expire_list) |
| 542 AppBannerSettingsHelper::ClearHistoryForURLs(profile, expire_entry.urls); | 543 AppBannerSettingsHelper::ClearHistoryForURLs(profile, expire_entry.urls); |
| 543 } | 544 } |
| 544 | 545 |
| 545 void BrowsingHistoryHandler::HandleClearBrowsingData( | 546 void BrowsingHistoryHandler::HandleClearBrowsingData( |
| 546 const base::ListValue* args) { | 547 const base::ListValue* args) { |
| 547 #if defined(OS_ANDROID) | 548 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 548 chrome::android::ChromeApplication::OpenClearBrowsingData( | 549 chrome::android::ChromeApplication::OpenClearBrowsingData( |
| 549 web_ui()->GetWebContents()); | 550 web_ui()->GetWebContents()); |
| 550 #else | 551 #else |
| 551 // TODO(beng): This is an improper direct dependency on Browser. Route this | 552 // TODO(beng): This is an improper direct dependency on Browser. Route this |
| 552 // through some sort of delegate. | 553 // through some sort of delegate. |
| 553 Browser* browser = chrome::FindBrowserWithWebContents( | 554 Browser* browser = chrome::FindBrowserWithWebContents( |
| 554 web_ui()->GetWebContents()); | 555 web_ui()->GetWebContents()); |
| 555 chrome::ShowClearBrowsingDataDialog(browser); | 556 chrome::ShowClearBrowsingDataDialog(browser); |
| 556 #endif | 557 #endif |
| 557 } | 558 } |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 876 | 877 |
| 877 void BrowsingHistoryHandler::OnURLsDeleted( | 878 void BrowsingHistoryHandler::OnURLsDeleted( |
| 878 history::HistoryService* history_service, | 879 history::HistoryService* history_service, |
| 879 bool all_history, | 880 bool all_history, |
| 880 bool expired, | 881 bool expired, |
| 881 const history::URLRows& deleted_rows, | 882 const history::URLRows& deleted_rows, |
| 882 const std::set<GURL>& favicon_urls) { | 883 const std::set<GURL>& favicon_urls) { |
| 883 if (all_history || DeletionsDiffer(deleted_rows, urls_to_be_deleted_)) | 884 if (all_history || DeletionsDiffer(deleted_rows, urls_to_be_deleted_)) |
| 884 web_ui()->CallJavascriptFunction("historyDeleted"); | 885 web_ui()->CallJavascriptFunction("historyDeleted"); |
| 885 } | 886 } |
| OLD | NEW |