| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/i18n/case_conversion.h" | 10 #include "base/i18n/case_conversion.h" |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 &default_search_provider, | 519 &default_search_provider, |
| 520 &new_resource_keyword_version); | 520 &new_resource_keyword_version); |
| 521 | 521 |
| 522 bool database_specified_a_default = NULL != default_search_provider; | 522 bool database_specified_a_default = NULL != default_search_provider; |
| 523 | 523 |
| 524 // Check if default search provider is now managed. | 524 // Check if default search provider is now managed. |
| 525 scoped_ptr<TemplateURL> default_from_prefs; | 525 scoped_ptr<TemplateURL> default_from_prefs; |
| 526 LoadDefaultSearchProviderFromPrefs(&default_from_prefs, | 526 LoadDefaultSearchProviderFromPrefs(&default_from_prefs, |
| 527 &is_default_search_managed_); | 527 &is_default_search_managed_); |
| 528 | 528 |
| 529 // TODO(sail): Re-enable the protector on Mac and Linux once various | 529 // TODO(sail): Re-enable the protector once various |
| 530 // crashes and UI issues are fixed. See http://crbug.com/102765 | 530 // crashes and UI issues are fixed. See http://crbug.com/102765 |
| 531 #if defined(OS_WIN) | 531 #if 0 |
| 532 // Check if the default search provider has been changed and notify | 532 // Check if the default search provider has been changed and notify |
| 533 // Protector instance about it. Don't check if the default search is | 533 // Protector instance about it. Don't check if the default search is |
| 534 // managed. | 534 // managed. |
| 535 const TemplateURL* backup_default_search_provider = NULL; | 535 const TemplateURL* backup_default_search_provider = NULL; |
| 536 if (!is_default_search_managed_ && | 536 if (!is_default_search_managed_ && |
| 537 DidDefaultSearchProviderChange( | 537 DidDefaultSearchProviderChange( |
| 538 *result, | 538 *result, |
| 539 template_urls, | 539 template_urls, |
| 540 &backup_default_search_provider)) { | 540 &backup_default_search_provider)) { |
| 541 // Protector will delete itself when it's needed no longer. | 541 // Protector will delete itself when it's needed no longer. |
| (...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1733 } else { | 1733 } else { |
| 1734 // Change the local TURL's GUID to the server's GUID and push an update to | 1734 // Change the local TURL's GUID to the server's GUID and push an update to |
| 1735 // Sync. This ensures that the rest of local_url's fields are sync'd up to | 1735 // Sync. This ensures that the rest of local_url's fields are sync'd up to |
| 1736 // the server, and the next time local_url is synced, it is recognized by | 1736 // the server, and the next time local_url is synced, it is recognized by |
| 1737 // having the same GUID. | 1737 // having the same GUID. |
| 1738 ResetTemplateURLGUID(local_turl, sync_turl->sync_guid()); | 1738 ResetTemplateURLGUID(local_turl, sync_turl->sync_guid()); |
| 1739 SyncData sync_data = CreateSyncDataFromTemplateURL(*local_turl); | 1739 SyncData sync_data = CreateSyncDataFromTemplateURL(*local_turl); |
| 1740 change_list->push_back(SyncChange(SyncChange::ACTION_UPDATE, sync_data)); | 1740 change_list->push_back(SyncChange(SyncChange::ACTION_UPDATE, sync_data)); |
| 1741 } | 1741 } |
| 1742 } | 1742 } |
| OLD | NEW |