| 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/profiles/profile.h" | 5 #include "chrome/browser/profiles/profile.h" |
| 6 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" | 6 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
| 7 #include "chrome/browser/search_engines/template_url_service.h" | 7 #include "chrome/browser/search_engines/template_url_service.h" |
| 8 #include "chrome/browser/search_engines/template_url_service_factory.h" | 8 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 content::Source<TemplateURLService>(model)); | 32 content::Source<TemplateURLService>(model)); |
| 33 model_->Load(); | 33 model_->Load(); |
| 34 content::RunMessageLoop(); | 34 content::RunMessageLoop(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 virtual void Observe(int type, | 37 virtual void Observe(int type, |
| 38 const content::NotificationSource& source, | 38 const content::NotificationSource& source, |
| 39 const content::NotificationDetails& details) { | 39 const content::NotificationDetails& details) { |
| 40 if (type == chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED && | 40 if (type == chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED && |
| 41 content::Source<TemplateURLService>(source).ptr() == model_) { | 41 content::Source<TemplateURLService>(source).ptr() == model_) { |
| 42 MessageLoop::current()->Quit(); | 42 base::MessageLoop::current()->Quit(); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 content::NotificationRegistrar registrar_; | 47 content::NotificationRegistrar registrar_; |
| 48 | 48 |
| 49 TemplateURLService* model_; | 49 TemplateURLService* model_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(TemplateURLServiceLoader); | 51 DISALLOW_COPY_AND_ASSIGN(TemplateURLServiceLoader); |
| 52 }; | 52 }; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 79 HTTPTestServer::CreateServerWithFileRootURL( | 79 HTTPTestServer::CreateServerWithFileRootURL( |
| 80 L"chrome/test/data/template_url_scraper/submit_handler", L"/", | 80 L"chrome/test/data/template_url_scraper/submit_handler", L"/", |
| 81 g_browser_process->io_thread()->message_loop())); | 81 g_browser_process->io_thread()->message_loop())); |
| 82 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( | 82 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( |
| 83 browser(), GURL("http://www.foo.com:1337/"), 2); | 83 browser(), GURL("http://www.foo.com:1337/"), 2); |
| 84 | 84 |
| 85 all_urls = template_urls->GetTemplateURLs(); | 85 all_urls = template_urls->GetTemplateURLs(); |
| 86 EXPECT_EQ(1, all_urls.size() - prepopulate_urls.size()); | 86 EXPECT_EQ(1, all_urls.size() - prepopulate_urls.size()); |
| 87 } | 87 } |
| 88 */ | 88 */ |
| OLD | NEW |