Remove dead code from ContextualSearch

Desktop / Chromium - Sylvain Defresne [chromium.org] - 19 October 2017 12:02 EDT

Inspecting the code revealed that ContextualSearchController -panel property was never set, and that the delegate passed to initializer was always a mock with no method mocked.

It follows that _panelView, _searchResultView and _headerView are always nil, and the delegate method always returned default value and were doing nothing. Remove all code that can be proved to be dead based on those observation and the fact that calling a method on nil received does nothing and return the default value for the method selector.

Bug: 775332 Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet Change-Id: I9fbd18c97e1f19f91384bb54d3102e2509f4ccb0 Reviewed-on: https://chromium-review.googlesource.com/727472

b9b5af0 Remove dead code from ContextualSearch.
ios/chrome/app/strings/ios_strings.grd | 20 -
.../contextual_search_header.png | Bin 245 -> 0 bytes
.../contextual_search_header.png | Bin 367 -> 0 bytes
.../contextual_search_header.png | Bin 716 -> 0 bytes
ios/chrome/app/theme/ios_theme_resources.grd | 1 -
.../images/chromium_branded_image_provider.h | 1 -
.../images/chromium_branded_image_provider.mm | 5 -
ios/chrome/browser/ui/contextual_search/BUILD.gn | 17 +-
.../contextual_search_controller.h | 43 +-
.../contextual_search_controller.mm | 363 +---------------
.../contextual_search_header_view.h | 34 --
.../contextual_search_header_view.mm | 401 ------------------
.../contextual_search_js_unittest.mm | 7 +-
.../contextual_search_mask_view.h | 26 --
.../contextual_search_mask_view.mm | 83 ----
.../contextual_search/contextual_search_metrics.h | 2 +-
.../contextual_search_panel_protocols.h | 82 ----
.../contextual_search_panel_state.h | 25 ++
.../contextual_search_panel_view.h | 55 ---
.../contextual_search_panel_view.mm | 463 ---------------------
.../contextual_search_promo_view.h | 35 --
.../contextual_search_promo_view.mm | 261 ------------
.../contextual_search_results_view.h | 58 ---
.../contextual_search_results_view.mm | 394 ------------------
.../contextual_search/contextual_search_wrangler.h | 93 -----
.../contextual_search_wrangler.mm | 304 --------------
.../ui/contextual_search/panel_configuration.h | 86 ----
.../ui/contextual_search/panel_configuration.mm | 241 -----------
.../ui/contextual_search/resources/BUILD.gn | 14 -
.../resources/expand_less.imageset/Contents.json | 23 -
.../resources/expand_less.imageset/expand_less.png | Bin 126 -> 0 bytes
.../expand_less.imageset/expand_less@2x.png | Bin 171 -> 0 bytes
.../expand_less.imageset/expand_less@3x.png | Bin 244 -> 0 bytes
.../browser/ui/contextual_search/settings/BUILD.gn | 48 ---
.../contextual_search_collection_view_controller.h | 34 --
...contextual_search_collection_view_controller.mm | 221 ----------
...l_search_collection_view_controller_unittest.mm | 75 ----
.../chrome/browser/images/branded_image_provider.h | 3 -
.../browser/images/branded_image_provider.mm | 4 -
39 files changed, 52 insertions(+), 3470 deletions(-)

Upstream: git.chromium.org


  • Share