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

Side by Side Diff: ios/chrome/browser/ui/omnibox/omnibox_popup_material_view_controller.mm

Issue 2629723002: Fix the layout of the append button on Answers in Suggest. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 #import "ios/chrome/browser/ui/omnibox/omnibox_popup_material_view_controller.h" 5 #import "ios/chrome/browser/ui/omnibox/omnibox_popup_material_view_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/ios/ios_util.h" 9 #include "base/ios/ios_util.h"
10 #include "base/mac/scoped_cftyperef.h" 10 #include "base/mac/scoped_cftyperef.h"
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 } else { 363 } else {
364 textLabel.attributedText = 364 textLabel.attributedText =
365 [self attributedStringWithString:text 365 [self attributedStringWithString:text
366 classifications:textClassifications 366 classifications:textClassifications
367 smallFont:NO 367 smallFont:NO
368 color:suggestionTextColor 368 color:suggestionTextColor
369 dimColor:dimColor]; 369 dimColor:dimColor];
370 } 370 }
371 [textLabel setNeedsDisplay]; 371 [textLabel setNeedsDisplay];
372 372
373 // The left image (e.g. magnifying glass, star, clock) is only shown on iPad. 373 // The leading image (e.g. magnifying glass, star, clock) is only shown on
374 // iPad.
374 if (IsIPadIdiom()) { 375 if (IsIPadIdiom()) {
375 int imageId = GetIconForAutocompleteMatchType( 376 int imageId = GetIconForAutocompleteMatchType(
376 match.type, _popupView->IsStarredMatch(match), _incognito); 377 match.type, _popupView->IsStarredMatch(match), _incognito);
377 [row updateLeftImage:imageId]; 378 [row updateLeadingImage:imageId];
378 } 379 }
379 380
380 // Show append button for search history/search suggestions/voice search as 381 // Show append button for search history/search suggestions/voice search as
381 // the right control element (aka an accessory element of a table view cell). 382 // the right control element (aka an accessory element of a table view cell).
382 BOOL autocompleteSearchMatch = 383 BOOL autocompleteSearchMatch =
383 match.type == AutocompleteMatchType::SEARCH_HISTORY || 384 match.type == AutocompleteMatchType::SEARCH_HISTORY ||
384 match.type == AutocompleteMatchType::SEARCH_SUGGEST; 385 match.type == AutocompleteMatchType::SEARCH_SUGGEST;
385 row.appendButton.hidden = !autocompleteSearchMatch; 386 row.appendButton.hidden = !autocompleteSearchMatch;
386 [row.appendButton cancelTrackingWithEvent:nil]; 387 [row.appendButton cancelTrackingWithEvent:nil];
387 388
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 // The delete button never disappears if you don't call this after a tap. 806 // The delete button never disappears if you don't call this after a tap.
806 // It doesn't seem to be required anywhere else. 807 // It doesn't seem to be required anywhere else.
807 [_rows[indexPath.row] prepareForReuse]; 808 [_rows[indexPath.row] prepareForReuse];
808 const AutocompleteMatch& match = 809 const AutocompleteMatch& match =
809 ((const AutocompleteResult&)_currentResult).match_at(indexPath.row); 810 ((const AutocompleteResult&)_currentResult).match_at(indexPath.row);
810 _popupView->DeleteMatch(match); 811 _popupView->DeleteMatch(match);
811 } 812 }
812 } 813 }
813 814
814 @end 815 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698