OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/search_engines/template_url_service.h" | 5 #include "components/search_engines/template_url_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 } | 740 } |
741 | 741 |
742 std::unique_ptr<TemplateURLService::Subscription> | 742 std::unique_ptr<TemplateURLService::Subscription> |
743 TemplateURLService::RegisterOnLoadedCallback(const base::Closure& callback) { | 743 TemplateURLService::RegisterOnLoadedCallback(const base::Closure& callback) { |
744 return loaded_ ? std::unique_ptr<TemplateURLService::Subscription>() | 744 return loaded_ ? std::unique_ptr<TemplateURLService::Subscription>() |
745 : on_loaded_callbacks_.Add(callback); | 745 : on_loaded_callbacks_.Add(callback); |
746 } | 746 } |
747 | 747 |
748 void TemplateURLService::OnWebDataServiceRequestDone( | 748 void TemplateURLService::OnWebDataServiceRequestDone( |
749 KeywordWebDataService::Handle h, | 749 KeywordWebDataService::Handle h, |
750 const WDTypedResult* result) { | 750 std::unique_ptr<WDTypedResult> result) { |
751 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is | 751 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is |
752 // fixed. | 752 // fixed. |
753 tracked_objects::ScopedTracker tracking_profile( | 753 tracked_objects::ScopedTracker tracking_profile( |
754 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 754 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
755 "422460 TemplateURLService::OnWebDataServiceRequestDone")); | 755 "422460 TemplateURLService::OnWebDataServiceRequestDone")); |
756 | 756 |
757 // Reset the load_handle so that we don't try and cancel the load in | 757 // Reset the load_handle so that we don't try and cancel the load in |
758 // the destructor. | 758 // the destructor. |
759 load_handle_ = 0; | 759 load_handle_ = 0; |
760 | 760 |
(...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2474 | 2474 |
2475 if (most_recently_intalled_default) { | 2475 if (most_recently_intalled_default) { |
2476 base::AutoReset<DefaultSearchChangeOrigin> change_origin( | 2476 base::AutoReset<DefaultSearchChangeOrigin> change_origin( |
2477 &dsp_change_origin_, DSP_CHANGE_OVERRIDE_SETTINGS_EXTENSION); | 2477 &dsp_change_origin_, DSP_CHANGE_OVERRIDE_SETTINGS_EXTENSION); |
2478 default_search_manager_.SetExtensionControlledDefaultSearchEngine( | 2478 default_search_manager_.SetExtensionControlledDefaultSearchEngine( |
2479 most_recently_intalled_default->data()); | 2479 most_recently_intalled_default->data()); |
2480 } else { | 2480 } else { |
2481 default_search_manager_.ClearExtensionControlledDefaultSearchEngine(); | 2481 default_search_manager_.ClearExtensionControlledDefaultSearchEngine(); |
2482 } | 2482 } |
2483 } | 2483 } |
OLD | NEW |