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 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 se_specifics->set_suggestions_url(turl.suggestions_url()); | 1308 se_specifics->set_suggestions_url(turl.suggestions_url()); |
1309 se_specifics->set_prepopulate_id(turl.prepopulate_id()); | 1309 se_specifics->set_prepopulate_id(turl.prepopulate_id()); |
1310 se_specifics->set_instant_url(turl.instant_url()); | 1310 se_specifics->set_instant_url(turl.instant_url()); |
1311 se_specifics->set_last_modified(turl.last_modified().ToInternalValue()); | 1311 se_specifics->set_last_modified(turl.last_modified().ToInternalValue()); |
1312 se_specifics->set_sync_guid(turl.sync_guid()); | 1312 se_specifics->set_sync_guid(turl.sync_guid()); |
1313 for (size_t i = 0; i < turl.alternate_urls().size(); ++i) | 1313 for (size_t i = 0; i < turl.alternate_urls().size(); ++i) |
1314 se_specifics->add_alternate_urls(turl.alternate_urls()[i]); | 1314 se_specifics->add_alternate_urls(turl.alternate_urls()[i]); |
1315 | 1315 |
1316 return syncer::SyncData::CreateLocalData(se_specifics->sync_guid(), | 1316 return syncer::SyncData::CreateLocalData(se_specifics->sync_guid(), |
1317 se_specifics->keyword(), | 1317 se_specifics->keyword(), |
1318 specifics); | 1318 specifics, false); |
1319 } | 1319 } |
1320 | 1320 |
1321 // static | 1321 // static |
1322 TemplateURL* TemplateURLService::CreateTemplateURLFromTemplateURLAndSyncData( | 1322 TemplateURL* TemplateURLService::CreateTemplateURLFromTemplateURLAndSyncData( |
1323 Profile* profile, | 1323 Profile* profile, |
1324 TemplateURL* existing_turl, | 1324 TemplateURL* existing_turl, |
1325 const syncer::SyncData& sync_data, | 1325 const syncer::SyncData& sync_data, |
1326 syncer::SyncChangeList* change_list) { | 1326 syncer::SyncChangeList* change_list) { |
1327 DCHECK(change_list); | 1327 DCHECK(change_list); |
1328 | 1328 |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2563 // TODO(mpcomplete): If we allow editing extension keywords, then those | 2563 // TODO(mpcomplete): If we allow editing extension keywords, then those |
2564 // should be persisted to disk and synced. | 2564 // should be persisted to disk and synced. |
2565 if (template_url->sync_guid().empty() && | 2565 if (template_url->sync_guid().empty() && |
2566 !template_url->IsExtensionKeyword()) { | 2566 !template_url->IsExtensionKeyword()) { |
2567 template_url->data_.sync_guid = base::GenerateGUID(); | 2567 template_url->data_.sync_guid = base::GenerateGUID(); |
2568 if (service_.get()) | 2568 if (service_.get()) |
2569 service_->UpdateKeyword(template_url->data()); | 2569 service_->UpdateKeyword(template_url->data()); |
2570 } | 2570 } |
2571 } | 2571 } |
2572 } | 2572 } |
OLD | NEW |