Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "components/omnibox/browser/zero_suggest_provider.h" | 5 #include "components/omnibox/browser/zero_suggest_provider.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 class FakeEmptyTopSites : public history::TopSites { | 29 class FakeEmptyTopSites : public history::TopSites { |
| 30 public: | 30 public: |
| 31 FakeEmptyTopSites() { | 31 FakeEmptyTopSites() { |
| 32 } | 32 } |
| 33 | 33 |
| 34 // history::TopSites: | 34 // history::TopSites: |
| 35 bool SetPageThumbnail(const GURL& url, const gfx::Image& thumbnail, | 35 bool SetPageThumbnail(const GURL& url, const gfx::Image& thumbnail, |
| 36 const ThumbnailScore& score) override { | 36 const ThumbnailScore& score) override { |
| 37 return false; | 37 return false; |
| 38 } | 38 } |
| 39 bool SetPageThumbnailToJPEGBytes(const GURL& url, | |
| 40 const base::RefCountedMemory* memory, | |
| 41 const ThumbnailScore& score) override { | |
| 42 return false; | |
| 43 } | |
| 44 void GetMostVisitedURLs(const GetMostVisitedURLsCallback& callback, | 39 void GetMostVisitedURLs(const GetMostVisitedURLsCallback& callback, |
| 45 bool include_forced_urls) override; | 40 bool include_forced_urls) override; |
| 46 bool GetPageThumbnail(const GURL& url, bool prefix_match, | 41 bool GetPageThumbnail(const GURL& url, bool prefix_match, |
| 47 scoped_refptr<base::RefCountedMemory>* bytes) override { | 42 scoped_refptr<base::RefCountedMemory>* bytes) override { |
| 48 return false; | 43 return false; |
| 49 } | 44 } |
| 50 bool GetPageThumbnailScore(const GURL& url, ThumbnailScore* score) override { | 45 bool GetPageThumbnailScore(const GURL& url, ThumbnailScore* score) override { |
| 51 return false; | 46 return false; |
| 52 } | 47 } |
| 53 bool GetTemporaryPageThumbnailScore(const GURL& url, ThumbnailScore* score) | 48 bool GetTemporaryPageThumbnailScore(const GURL& url, ThumbnailScore* score) |
| 54 override { | 49 override { |
| 55 return false; | 50 return false; |
| 56 } | 51 } |
| 57 void SyncWithHistory() override {} | 52 void SyncWithHistory() override {} |
| 58 bool HasBlacklistedItems() const override { | 53 bool HasBlacklistedItems() const override { |
| 59 return false; | 54 return false; |
| 60 } | 55 } |
| 61 void AddBlacklistedURL(const GURL& url) override {} | 56 void AddBlacklistedURL(const GURL& url) override {} |
| 62 void RemoveBlacklistedURL(const GURL& url) override {} | 57 void RemoveBlacklistedURL(const GURL& url) override {} |
| 63 bool IsBlacklisted(const GURL& url) override { | 58 bool IsBlacklisted(const GURL& url) override { |
| 64 return false; | 59 return false; |
| 65 } | 60 } |
| 66 void ClearBlacklistedURLs() override {} | 61 void ClearBlacklistedURLs() override {} |
| 67 base::CancelableTaskTracker::TaskId StartQueryForMostVisited() override { | |
| 68 return 0; | |
| 69 } | |
| 70 bool IsKnownURL(const GURL& url) override { | 62 bool IsKnownURL(const GURL& url) override { |
| 71 return false; | 63 return false; |
| 72 } | 64 } |
| 73 const std::string& GetCanonicalURLString(const GURL& url) const override { | |
| 74 CHECK(false); | |
| 75 return *(new std::string()); | |
|
msw
2016/12/13 22:31:53
wow, glad we're removing this!
| |
| 76 } | |
| 77 bool IsNonForcedFull() override { | 65 bool IsNonForcedFull() override { |
| 78 return false; | 66 return false; |
| 79 } | 67 } |
| 80 bool IsForcedFull() override { | 68 bool IsForcedFull() override { |
| 81 return false; | 69 return false; |
| 82 } | 70 } |
| 83 bool loaded() const override { | 71 bool loaded() const override { |
| 84 return false; | 72 return false; |
| 85 } | 73 } |
| 86 history::PrepopulatedPageList GetPrepopulatedPages() override { | 74 history::PrepopulatedPageList GetPrepopulatedPages() override { |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 453 | 441 |
| 454 base::RunLoop().RunUntilIdle(); | 442 base::RunLoop().RunUntilIdle(); |
| 455 | 443 |
| 456 // Expect that the matches have been cleared. | 444 // Expect that the matches have been cleared. |
| 457 ASSERT_TRUE(provider_->matches().empty()); | 445 ASSERT_TRUE(provider_->matches().empty()); |
| 458 | 446 |
| 459 // Expect the new results have been stored. | 447 // Expect the new results have been stored. |
| 460 EXPECT_EQ(empty_response, | 448 EXPECT_EQ(empty_response, |
| 461 prefs->GetString(omnibox::kZeroSuggestCachedResults)); | 449 prefs->GetString(omnibox::kZeroSuggestCachedResults)); |
| 462 } | 450 } |
| OLD | NEW |