|
|
When the Google base URL changes and causes keyword updates, save those to the database and send them to sync. Note that even if the database had the wrong keyword, a TemplateURL would get reset to the correct keyword on next load (in the model, not in the database), so this is mostly useful for keeping state as consistent as possible rather than preventing visible local problems.
One tricky bit here is that we don't want these sorts of changes to change the keywords of existing URLs in other sync clients, lest we give an entry the wrong keyword for the local environment. I could have dealt with this by never sending such updates to sync at all, but given that remote clients need to deal with these sorts of issues anyway for other reasons (e.g. a user adding a new TemplateURL that uses Google base URLs), it seemed less error-prone to use the standard UpdateNoNotify() functionality and then ensure remote clients handle things correctly. This will also ensure that if we e.g. change the TemplateURL's last_modified date when updating the base URL, that change will get propagated to sync, which is (once again) good for keeping the server and all clients seeing the most consistent state possible.
BUG= 128249
TEST=none
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=140608
Total comments: 6
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+190 lines, -145 lines) |
Patch |
 |
M |
chrome/browser/google/google_url_tracker.h
|
View
|
1
2
3
4
|
5 chunks |
+9 lines, -5 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/google/google_url_tracker.cc
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/search_engines/search_host_to_urls_map.h
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -4 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/search_engines/search_host_to_urls_map.cc
|
View
|
1
2
3
4
|
2 chunks |
+4 lines, -25 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/search_engines/search_host_to_urls_map_unittest.cc
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -22 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/search_engines/search_provider_install_data.cc
|
View
|
1
2
3
4
|
2 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/search_engines/template_url.h
|
View
|
1
2
3
4
|
1 chunk |
+0 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/search_engines/template_url.cc
|
View
|
1
2
3
4
|
1 chunk |
+0 lines, -7 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/search_engines/template_url_service.h
|
View
|
1
2
3
4
|
3 chunks |
+4 lines, -9 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/search_engines/template_url_service.cc
|
View
|
1
2
3
4
|
15 chunks |
+96 lines, -45 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/search_engines/template_url_service_sync_unittest.cc
|
View
|
1
2
3
4
|
2 chunks |
+38 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/search_engines/template_url_service_test_util.cc
|
View
|
1
2
3
4
|
2 chunks |
+5 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/search_engines/template_url_service_unittest.cc
|
View
|
1
2
3
4
|
2 chunks |
+22 lines, -19 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/search_engines/util.cc
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/common/chrome_notification_types.h
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
Total messages: 4 (0 generated)
|