Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: chrome/browser/search_engines/template_url_service_test_util.cc

Issue 9703038: Profiles: Really fix refcounted services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgot to save a file. >_< Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 scoped_refptr<WebDataService> service_; 68 scoped_refptr<WebDataService> service_;
69 ScopedTempDir temp_dir_; 69 ScopedTempDir temp_dir_;
70 content::TestBrowserThread db_thread_; 70 content::TestBrowserThread db_thread_;
71 content::TestBrowserThread io_thread_; 71 content::TestBrowserThread io_thread_;
72 }; 72 };
73 73
74 // Trivial subclass of TemplateURLService that records the last invocation of 74 // Trivial subclass of TemplateURLService that records the last invocation of
75 // SetKeywordSearchTermsForURL. 75 // SetKeywordSearchTermsForURL.
76 class TestingTemplateURLService : public TemplateURLService { 76 class TestingTemplateURLService : public TemplateURLService {
77 public: 77 public:
78 static ProfileKeyedBase* Build(Profile* profile) { 78 static ProfileKeyedService* Build(Profile* profile) {
79 return new TestingTemplateURLService(profile); 79 return new TestingTemplateURLService(profile);
80 } 80 }
81 81
82 explicit TestingTemplateURLService(Profile* profile) 82 explicit TestingTemplateURLService(Profile* profile)
83 : TemplateURLService(profile) { 83 : TemplateURLService(profile) {
84 } 84 }
85 85
86 string16 GetAndClearSearchTerm() { 86 string16 GetAndClearSearchTerm() {
87 string16 search_term; 87 string16 search_term;
88 search_term.swap(search_term_); 88 search_term.swap(search_term_);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 return TemplateURLServiceFactory::GetForProfile(profile()); 234 return TemplateURLServiceFactory::GetForProfile(profile());
235 } 235 }
236 236
237 TestingProfile* TemplateURLServiceTestUtil::profile() const { 237 TestingProfile* TemplateURLServiceTestUtil::profile() const {
238 return profile_.get(); 238 return profile_.get();
239 } 239 }
240 240
241 void TemplateURLServiceTestUtil::StartIOThread() { 241 void TemplateURLServiceTestUtil::StartIOThread() {
242 profile_->StartIOThread(); 242 profile_->StartIOThread();
243 } 243 }
OLDNEW
« no previous file with comments | « chrome/browser/protector/mock_protector_service.cc ('k') | chrome/browser/signin/signin_manager_fake.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698