testing_search_terms_data.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2014 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_SEARCH_ENGINES_TESTING_SEARCH_TERMS_DATA_H_
  5. #define COMPONENTS_SEARCH_ENGINES_TESTING_SEARCH_TERMS_DATA_H_
  6. #include "components/search_engines/search_terms_data.h"
  7. class TestingSearchTermsData : public SearchTermsData {
  8. public:
  9. explicit TestingSearchTermsData(const std::string& google_base_url);
  10. TestingSearchTermsData(const TestingSearchTermsData&) = delete;
  11. TestingSearchTermsData& operator=(const TestingSearchTermsData&) = delete;
  12. ~TestingSearchTermsData() override;
  13. std::string GoogleBaseURLValue() const override;
  14. std::u16string GetRlzParameterValue(bool from_app_list) const override;
  15. std::string GetSearchClient() const override;
  16. std::string GetSuggestClient(bool non_searchbox_ntp) const override;
  17. std::string GoogleImageSearchSource() const override;
  18. // Estimates dynamic memory usage.
  19. // See base/trace_event/memory_usage_estimator.h for more info.
  20. size_t EstimateMemoryUsage() const override;
  21. void set_google_base_url(const std::string& google_base_url) {
  22. google_base_url_ = google_base_url;
  23. }
  24. void set_search_client(const std::string& search_client) {
  25. search_client_ = search_client;
  26. }
  27. void set_suggest_client(const std::string& suggest_client) {
  28. suggest_client_ = suggest_client;
  29. }
  30. private:
  31. std::string google_base_url_;
  32. std::string search_client_;
  33. std::string suggest_client_;
  34. };
  35. #endif // COMPONENTS_SEARCH_ENGINES_TESTING_SEARCH_TERMS_DATA_H_