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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "ui/base/l10n/time_format.h" | 48 #include "ui/base/l10n/time_format.h" |
49 | 49 |
50 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) | 50 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
51 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h" | 51 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h" |
52 #include "chrome/browser/supervised_user/supervised_user_service.h" | 52 #include "chrome/browser/supervised_user/supervised_user_service.h" |
53 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | 53 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
54 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" | 54 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" |
55 #endif | 55 #endif |
56 | 56 |
57 #if defined(OS_ANDROID) | 57 #if defined(OS_ANDROID) |
58 #include "chrome/browser/android/chrome_application.h" | 58 #include "chrome/browser/android/preferences/preferences_launcher.h" |
59 #else | 59 #else |
60 #include "chrome/common/chrome_features.h" | 60 #include "chrome/common/chrome_features.h" |
61 #endif | 61 #endif |
62 | 62 |
63 // Number of chars to truncate titles when making them "short". | 63 // Number of chars to truncate titles when making them "short". |
64 static const size_t kShortTitleLength = 300; | 64 static const size_t kShortTitleLength = 300; |
65 | 65 |
66 using bookmarks::BookmarkModel; | 66 using bookmarks::BookmarkModel; |
67 | 67 |
68 namespace { | 68 namespace { |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 items_to_remove.push_back(std::move(entry)); | 396 items_to_remove.push_back(std::move(entry)); |
397 } | 397 } |
398 | 398 |
399 browsing_history_service_->RemoveVisits(&items_to_remove); | 399 browsing_history_service_->RemoveVisits(&items_to_remove); |
400 items_to_remove.clear(); | 400 items_to_remove.clear(); |
401 } | 401 } |
402 | 402 |
403 void BrowsingHistoryHandler::HandleClearBrowsingData( | 403 void BrowsingHistoryHandler::HandleClearBrowsingData( |
404 const base::ListValue* args) { | 404 const base::ListValue* args) { |
405 #if defined(OS_ANDROID) | 405 #if defined(OS_ANDROID) |
406 chrome::android::ChromeApplication::OpenClearBrowsingData( | 406 chrome::android::PreferencesLauncher::OpenClearBrowsingData( |
407 web_ui()->GetWebContents()); | 407 web_ui()->GetWebContents()); |
408 #else | 408 #else |
409 // TODO(beng): This is an improper direct dependency on Browser. Route this | 409 // TODO(beng): This is an improper direct dependency on Browser. Route this |
410 // through some sort of delegate. | 410 // through some sort of delegate. |
411 Browser* browser = chrome::FindBrowserWithWebContents( | 411 Browser* browser = chrome::FindBrowserWithWebContents( |
412 web_ui()->GetWebContents()); | 412 web_ui()->GetWebContents()); |
413 chrome::ShowClearBrowsingDataDialog(browser); | 413 chrome::ShowClearBrowsingDataDialog(browser); |
414 #endif | 414 #endif |
415 } | 415 } |
416 | 416 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 web_ui()->CallJavascriptFunctionUnsafe("historyDeleted"); | 552 web_ui()->CallJavascriptFunctionUnsafe("historyDeleted"); |
553 } | 553 } |
554 | 554 |
555 void BrowsingHistoryHandler::HasOtherFormsOfBrowsingHistory( | 555 void BrowsingHistoryHandler::HasOtherFormsOfBrowsingHistory( |
556 bool has_other_forms, | 556 bool has_other_forms, |
557 bool has_synced_results) { | 557 bool has_synced_results) { |
558 web_ui()->CallJavascriptFunctionUnsafe("showNotification", | 558 web_ui()->CallJavascriptFunctionUnsafe("showNotification", |
559 base::Value(has_synced_results), | 559 base::Value(has_synced_results), |
560 base::Value(has_other_forms)); | 560 base::Value(has_other_forms)); |
561 } | 561 } |
OLD | NEW |