| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/prefs/testing_pref_service.h" | 8 #include "base/prefs/testing_pref_service.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 private: | 56 private: |
| 57 // Keep track of the most recently created instance, so that it can be | 57 // Keep track of the most recently created instance, so that it can be |
| 58 // associated with the current profile when Build() is called. | 58 // associated with the current profile when Build() is called. |
| 59 static MockWebDataService* current_mock_web_data_service_; | 59 static MockWebDataService* current_mock_web_data_service_; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 MockWebDataService* MockWebDataService::current_mock_web_data_service_ = NULL; | 62 MockWebDataService* MockWebDataService::current_mock_web_data_service_ = NULL; |
| 63 | 63 |
| 64 class MockWebDataServiceWrapperCurrent : public MockWebDataServiceWrapperBase { | 64 class MockWebDataServiceWrapperCurrent : public MockWebDataServiceWrapperBase { |
| 65 public: | 65 public: |
| 66 static ProfileKeyedService* Build(content::BrowserContext* profile) { | 66 static BrowserContextKeyedService* Build(content::BrowserContext* profile) { |
| 67 return new MockWebDataServiceWrapperCurrent(); | 67 return new MockWebDataServiceWrapperCurrent(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 MockWebDataServiceWrapperCurrent() {} | 70 MockWebDataServiceWrapperCurrent() {} |
| 71 | 71 |
| 72 virtual scoped_refptr<AutofillWebDataService> GetAutofillWebData() OVERRIDE { | 72 virtual scoped_refptr<AutofillWebDataService> GetAutofillWebData() OVERRIDE { |
| 73 return MockWebDataService::GetCurrent(); | 73 return MockWebDataService::GetCurrent(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 private: | 76 private: |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 262 |
| 263 MockAutofillExternalDelegate external_delegate(web_contents()); | 263 MockAutofillExternalDelegate external_delegate(web_contents()); |
| 264 autocomplete_history_manager.SetExternalDelegate(&external_delegate); | 264 autocomplete_history_manager.SetExternalDelegate(&external_delegate); |
| 265 | 265 |
| 266 // Should trigger a call to OnSuggestionsReturned, verified by the mock. | 266 // Should trigger a call to OnSuggestionsReturned, verified by the mock. |
| 267 EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _)); | 267 EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _)); |
| 268 autocomplete_history_manager.SendSuggestions(NULL); | 268 autocomplete_history_manager.SendSuggestions(NULL); |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace autofill | 271 } // namespace autofill |
| OLD | NEW |