| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/search_engines/template_url_service_test_util.h" | 5 #include "chrome/browser/search_engines/template_url_service_test_util.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // Trivial subclass of TemplateURLService that records the last invocation of | 25 // Trivial subclass of TemplateURLService that records the last invocation of |
| 26 // SetKeywordSearchTermsForURL. | 26 // SetKeywordSearchTermsForURL. |
| 27 class TestingTemplateURLService : public TemplateURLService { | 27 class TestingTemplateURLService : public TemplateURLService { |
| 28 public: | 28 public: |
| 29 static KeyedService* Build(content::BrowserContext* profile) { | 29 static KeyedService* Build(content::BrowserContext* profile) { |
| 30 return new TestingTemplateURLService(static_cast<Profile*>(profile)); | 30 return new TestingTemplateURLService(static_cast<Profile*>(profile)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 explicit TestingTemplateURLService(Profile* profile) | 33 explicit TestingTemplateURLService(Profile* profile) |
| 34 : TemplateURLService(profile, NULL) { | 34 : TemplateURLService(profile, NULL, base::Closure()) { |
| 35 } | 35 } |
| 36 | 36 |
| 37 base::string16 GetAndClearSearchTerm() { | 37 base::string16 GetAndClearSearchTerm() { |
| 38 base::string16 search_term; | 38 base::string16 search_term; |
| 39 search_term.swap(search_term_); | 39 search_term.swap(search_term_); |
| 40 return search_term; | 40 return search_term; |
| 41 } | 41 } |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 virtual void SetKeywordSearchTermsForURL( | 44 virtual void SetKeywordSearchTermsForURL( |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 UIThreadSearchTermsData::SetGoogleBaseURL(std::string()); | 224 UIThreadSearchTermsData::SetGoogleBaseURL(std::string()); |
| 225 | 225 |
| 226 // Flush the message loop to make application verifiers happy. | 226 // Flush the message loop to make application verifiers happy. |
| 227 base::RunLoop().RunUntilIdle(); | 227 base::RunLoop().RunUntilIdle(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 TestingProfile* TemplateURLServiceTestUtil::profile() const { | 230 TestingProfile* TemplateURLServiceTestUtil::profile() const { |
| 231 return profile_.get(); | 231 return profile_.get(); |
| 232 } | 232 } |
| OLD | NEW |