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/search_engines/template_url_service.h" | 5 #include "chrome/browser/search_engines/template_url_service.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 content::Details<GoogleURLTracker::UpdatedDetails>(details)->first); | 871 content::Details<GoogleURLTracker::UpdatedDetails>(details)->first); |
872 } | 872 } |
873 } else { | 873 } else { |
874 NOTREACHED(); | 874 NOTREACHED(); |
875 } | 875 } |
876 } | 876 } |
877 | 877 |
878 void TemplateURLService::Shutdown() { | 878 void TemplateURLService::Shutdown() { |
879 // This check has to be done at Shutdown() instead of in the dtor to ensure | 879 // This check has to be done at Shutdown() instead of in the dtor to ensure |
880 // that no clients of WebDataService are holding ptrs to it after the first | 880 // that no clients of WebDataService are holding ptrs to it after the first |
881 // phase of the ProfileKeyedService Shutdown() process. | 881 // phase of the BrowserContextKeyedService Shutdown() process. |
882 if (load_handle_) { | 882 if (load_handle_) { |
883 DCHECK(service_.get()); | 883 DCHECK(service_.get()); |
884 service_->CancelRequest(load_handle_); | 884 service_->CancelRequest(load_handle_); |
885 } | 885 } |
886 service_ = NULL; | 886 service_ = NULL; |
887 } | 887 } |
888 | 888 |
889 void TemplateURLService::OnSyncedDefaultSearchProviderGUIDChanged() { | 889 void TemplateURLService::OnSyncedDefaultSearchProviderGUIDChanged() { |
890 // Listen for changes to the default search from Sync. | 890 // Listen for changes to the default search from Sync. |
891 PrefService* prefs = GetPrefs(); | 891 PrefService* prefs = GetPrefs(); |
(...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2490 // TODO(mpcomplete): If we allow editing extension keywords, then those | 2490 // TODO(mpcomplete): If we allow editing extension keywords, then those |
2491 // should be persisted to disk and synced. | 2491 // should be persisted to disk and synced. |
2492 if (template_url->sync_guid().empty() && | 2492 if (template_url->sync_guid().empty() && |
2493 !template_url->IsExtensionKeyword()) { | 2493 !template_url->IsExtensionKeyword()) { |
2494 template_url->data_.sync_guid = base::GenerateGUID(); | 2494 template_url->data_.sync_guid = base::GenerateGUID(); |
2495 if (service_.get()) | 2495 if (service_.get()) |
2496 service_->UpdateKeyword(template_url->data()); | 2496 service_->UpdateKeyword(template_url->data()); |
2497 } | 2497 } |
2498 } | 2498 } |
2499 } | 2499 } |
OLD | NEW |