| 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 16 #include "base/metrics/field_trial.h" | 16 #include "base/metrics/field_trial.h" |
| 17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| 20 #include "chrome/browser/browsing_data/browsing_data_filter_builder.h" | 20 #include "chrome/browser/browsing_data/browsing_data_filter_builder.h" |
| 21 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 21 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 22 #include "chrome/browser/browsing_data/browsing_data_remover.h" | |
| 23 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" | 22 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" |
| 23 #include "chrome/browser/browsing_data/browsing_data_remover_impl.h" |
| 24 #include "chrome/browser/browsing_data/origin_filter_builder.h" | 24 #include "chrome/browser/browsing_data/origin_filter_builder.h" |
| 25 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h" | 25 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h" |
| 26 #include "chrome/browser/search_engines/template_url_service_factory.h" | 26 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 27 #include "chrome/test/base/testing_profile.h" | 27 #include "chrome/test/base/testing_profile.h" |
| 28 #include "components/content_settings/core/browser/host_content_settings_map.h" | 28 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 29 #include "components/search_engines/template_url_service.h" | 29 #include "components/search_engines/template_url_service.h" |
| 30 #include "components/variations/entropy_provider.h" | 30 #include "components/variations/entropy_provider.h" |
| 31 #include "components/variations/variations_associated_data.h" | 31 #include "components/variations/variations_associated_data.h" |
| 32 #include "components/version_info/version_info.h" | 32 #include "components/version_info/version_info.h" |
| 33 #include "content/public/browser/navigation_controller.h" | 33 #include "content/public/browser/navigation_controller.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 EXPECT_EQ(url_rewritten, entry->GetURL()); | 338 EXPECT_EQ(url_rewritten, entry->GetURL()); |
| 339 EXPECT_EQ(url_original, entry->GetVirtualURL()); | 339 EXPECT_EQ(url_original, entry->GetVirtualURL()); |
| 340 } | 340 } |
| 341 | 341 |
| 342 } // namespace content | 342 } // namespace content |
| 343 #endif // !defined(OS_ANDROID) | 343 #endif // !defined(OS_ANDROID) |
| 344 | 344 |
| 345 namespace { | 345 namespace { |
| 346 | 346 |
| 347 // A BrowsingDataRemover that only records calls. | 347 // A BrowsingDataRemover that only records calls. |
| 348 class MockBrowsingDataRemover : public BrowsingDataRemover { | 348 // TODO(msramek): Once BrowsingDataRemoverImpl moves to content/ (non-public), |
| 349 // it will not be possible to inherit from it here. However, at that time |
| 350 // this functionality will become redundant, as it will no longer be necessary |
| 351 // to call to chrome/ to perform deletion. Remove it then. |
| 352 class MockBrowsingDataRemover : public BrowsingDataRemoverImpl { |
| 349 public: | 353 public: |
| 350 explicit MockBrowsingDataRemover(content::BrowserContext* context) | 354 explicit MockBrowsingDataRemover(content::BrowserContext* context) |
| 351 : BrowsingDataRemover(context) {} | 355 : BrowsingDataRemoverImpl(context) {} |
| 352 | 356 |
| 353 ~MockBrowsingDataRemover() override { | 357 ~MockBrowsingDataRemover() override { |
| 354 DCHECK(!expected_calls_.size()) | 358 DCHECK(!expected_calls_.size()) |
| 355 << "Expectations were set but not verified."; | 359 << "Expectations were set but not verified."; |
| 356 } | 360 } |
| 357 | 361 |
| 358 void RemoveInternal(const base::Time& delete_begin, | 362 void RemoveInternal(const base::Time& delete_begin, |
| 359 const base::Time& delete_end, | 363 const base::Time& delete_end, |
| 360 int remove_mask, | 364 int remove_mask, |
| 361 int origin_type_mask, | 365 int origin_type_mask, |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 client.ClearSiteData( | 723 client.ClearSiteData( |
| 720 profile(), origin, true /* cookies */, false /* storage */, | 724 profile(), origin, true /* cookies */, false /* storage */, |
| 721 true /* cache */, | 725 true /* cache */, |
| 722 base::Bind( | 726 base::Bind( |
| 723 &ChromeContentBrowserClientClearSiteDataTest::SetClearingFinished, | 727 &ChromeContentBrowserClientClearSiteDataTest::SetClearingFinished, |
| 724 base::Unretained(this), true)); | 728 base::Unretained(this), true)); |
| 725 EXPECT_TRUE(IsClearingFinished()); | 729 EXPECT_TRUE(IsClearingFinished()); |
| 726 } | 730 } |
| 727 | 731 |
| 728 } // namespace | 732 } // namespace |
| OLD | NEW |