Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(517)

Issue 10033017: More misc. cleanups to minimize future refactoring diffs. (Closed)

Created:
8 years, 8 months ago by Peter Kasting
Modified:
8 years, 8 months ago
CC:
chromium-reviews, ncarter (slow), creis+watch_chromium.org, akalin, tfarina, dhollowa+watch_chromium.org, brettw-cc_chromium.org, Avi (use Gerrit), ajwong+watch_chromium.org, James Su, tim (not reviewing)
Visibility:
Public.

Description

More misc. cleanups to minimize future refactoring diffs: * Fix indentation * Slightly more const-correct TemplateURLData functions * Use EXPECT_XXX() where possible, but ASSERT_XXX() to avoid crashes on expectation failure * Remove unneeded #include * Simplify AlternateErrorPageTabObserver slightly by having constructor take a Profile * Shorter/simpler code * Fix ordering in some places to be more consistent (e.g. matching member declaration order) * Add some DCHECK()s to make more explicit some conditions that will become important later Also, template_url_service.cc has some functional changes: * GetTemplateURLForXXX() functions now return correct values when asked for the default search URL before the model has successfully loaded. I wound up needing this later to fix some case, but I forget what now; the change seems more correct anyway. * Similarly, UnregisterExtensionKeyword() now works correctly if called before loading has finished * RegisterExtensionKeyword() now does nothing when there's already a keyword for that extension, as the comments in the header claim. I'd think this wouldn't actually matter in normal use as I think extension upgrades first unregister the old extension? (I don't remember if I checked that, though) * Don't try to set an extension keyword as default -- this would be a bad UX as these are inherently async. I don't think this should have been possible anyway except maybe if there was some kind of unintentional overlap between extensions and policy?? * Don't try to save extension keywords to disk or sync them (as the extension system should be responsible for registering them if necessary on startup in both these cases). We already avoided syncing these, I just added checks in more places; I no longer recall if we had code to avoid persisting these to disk, I don't seem to see any at the moment. (sky?) BUG=none TEST=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=131619

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Patch Set 3 : #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+331 lines, -276 lines) Patch
M chrome/browser/autocomplete/keyword_provider.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.h View 1 3 chunks +16 lines, -15 lines 2 comments Download
M chrome/browser/autocomplete/search_provider.cc View 7 chunks +29 lines, -26 lines 0 comments Download
M chrome/browser/autocomplete/search_provider_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/importer/profile_import_process_messages.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/instant/instant_browsertest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/instant/instant_loader.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/protector/default_search_provider_change_browsertest.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/search_engines/search_host_to_urls_map.cc View 1 chunk +7 lines, -10 lines 0 comments Download
M chrome/browser/search_engines/search_provider_install_data.cc View 2 chunks +3 lines, -5 lines 2 comments Download
M chrome/browser/search_engines/template_url.h View 5 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/search_engines/template_url.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/search_engines/template_url_fetcher_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/search_engines/template_url_parser.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/search_engines/template_url_service.h View 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/search_engines/template_url_service.cc View 1 2 36 chunks +192 lines, -130 lines 2 comments Download
M chrome/browser/search_engines/template_url_service_sync_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/search_engines/template_url_service_test_util.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/search_engines/template_url_service_unittest.cc View 2 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/search_engines/template_url_unittest.cc View 1 3 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/sync/test/integration/search_engines_helper.cc View 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/tab_contents/render_view_context_menu.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ui/alternate_error_tab_observer.h View 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/alternate_error_tab_observer.cc View 4 chunks +15 lines, -29 lines 0 comments Download
M chrome/browser/ui/search_engines/edit_search_engine_controller.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/search_engines/keyword_editor_controller.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/tab_contents/tab_contents_wrapper.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/options2/search_engine_manager_handler2.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/webdata/keyword_table_unittest.cc View 11 chunks +21 lines, -20 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Peter Kasting
sky: review atwilson: chrome/browser/sync OWNERS https://chromiumcodereview.appspot.com/10033017/diff/1/chrome/browser/instant/instant_loader.cc File chrome/browser/instant/instant_loader.cc (right): https://chromiumcodereview.appspot.com/10033017/diff/1/chrome/browser/instant/instant_loader.cc#newcode1133 chrome/browser/instant/instant_loader.cc:1133: TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16())); sky, please ...
8 years, 8 months ago (2012-04-10 01:24:33 UTC) #1
sky
https://chromiumcodereview.appspot.com/10033017/diff/5009/chrome/browser/autocomplete/search_provider.h File chrome/browser/autocomplete/search_provider.h (right): https://chromiumcodereview.appspot.com/10033017/diff/5009/chrome/browser/autocomplete/search_provider.h#newcode123 chrome/browser/autocomplete/search_provider.h:123: bool valid_default_provider() const { return !!default_provider_; } nit: !! ...
8 years, 8 months ago (2012-04-10 16:16:21 UTC) #2
Peter Kasting
https://chromiumcodereview.appspot.com/10033017/diff/5009/chrome/browser/autocomplete/search_provider.h File chrome/browser/autocomplete/search_provider.h (right): https://chromiumcodereview.appspot.com/10033017/diff/5009/chrome/browser/autocomplete/search_provider.h#newcode123 chrome/browser/autocomplete/search_provider.h:123: bool valid_default_provider() const { return !!default_provider_; } On 2012/04/10 ...
8 years, 8 months ago (2012-04-10 17:53:43 UTC) #3
sky
LGTM
8 years, 8 months ago (2012-04-10 19:47:06 UTC) #4
Raghu Simha
8 years, 8 months ago (2012-04-10 20:14:01 UTC) #5
Sync change LGTM.

Powered by Google App Engine
This is Rietveld 408576698