| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/views/frame/test_with_browser_view.h" | 5 #include "chrome/browser/ui/views/frame/test_with_browser_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 7 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
| 8 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" | 8 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" |
| 9 #include "chrome/browser/autocomplete/autocomplete_controller.h" | 9 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
| 10 #include "chrome/browser/predictors/predictor_database.h" | 10 #include "chrome/browser/predictors/predictor_database.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h" | 24 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h" |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 // Caller owns the returned service. | 29 // Caller owns the returned service. |
| 30 KeyedService* CreateTemplateURLService(content::BrowserContext* profile) { | 30 KeyedService* CreateTemplateURLService(content::BrowserContext* profile) { |
| 31 return new TemplateURLService(static_cast<Profile*>(profile), NULL); | 31 return new TemplateURLService(static_cast<Profile*>(profile), NULL); |
| 32 } | 32 } |
| 33 | 33 |
| 34 KeyedService* CreateAutocompleteClassifier(content::BrowserContext* context) { | 34 KeyedService* CreateAutocompleteClassifier(content::BrowserContext* profile) { |
| 35 Profile* profile = static_cast<Profile*>(context); | |
| 36 return new AutocompleteClassifier( | 35 return new AutocompleteClassifier( |
| 37 make_scoped_ptr(new AutocompleteController( | 36 make_scoped_ptr(new AutocompleteController( |
| 38 profile, TemplateURLServiceFactory::GetForProfile(profile), NULL, | 37 static_cast<Profile*>(profile), NULL, |
| 39 AutocompleteClassifier::kDefaultOmniboxProviders)), | 38 AutocompleteClassifier::kDefaultOmniboxProviders)), |
| 40 scoped_ptr<AutocompleteSchemeClassifier>(new TestSchemeClassifier())); | 39 scoped_ptr<AutocompleteSchemeClassifier>(new TestSchemeClassifier())); |
| 41 } | 40 } |
| 42 | 41 |
| 43 } // namespace | 42 } // namespace |
| 44 | 43 |
| 45 TestWithBrowserView::TestWithBrowserView() { | 44 TestWithBrowserView::TestWithBrowserView() { |
| 46 } | 45 } |
| 47 | 46 |
| 48 TestWithBrowserView::TestWithBrowserView( | 47 TestWithBrowserView::TestWithBrowserView( |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 AutocompleteClassifierFactory::GetInstance()->SetTestingFactory( | 101 AutocompleteClassifierFactory::GetInstance()->SetTestingFactory( |
| 103 profile, &CreateAutocompleteClassifier); | 102 profile, &CreateAutocompleteClassifier); |
| 104 return profile; | 103 return profile; |
| 105 } | 104 } |
| 106 | 105 |
| 107 BrowserWindow* TestWithBrowserView::CreateBrowserWindow() { | 106 BrowserWindow* TestWithBrowserView::CreateBrowserWindow() { |
| 108 // Allow BrowserWithTestWindowTest to use Browser to create the default | 107 // Allow BrowserWithTestWindowTest to use Browser to create the default |
| 109 // BrowserView and BrowserFrame. | 108 // BrowserView and BrowserFrame. |
| 110 return NULL; | 109 return NULL; |
| 111 } | 110 } |
| OLD | NEW |