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

Side by Side Diff: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc

Issue 2581513002: Replace hard-coded colors from ui::NativeTheme for consistency and accessibility. (Closed)
Patch Set: Resolved conflicts during patching 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
OLDNEW
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/ui/autofill/autofill_popup_controller_impl.h" 5 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 #include "chrome/browser/ui/autofill/autofill_popup_view.h" 15 #include "chrome/browser/ui/autofill/autofill_popup_view.h"
16 #include "chrome/browser/ui/autofill/popup_constants.h"
17 #include "components/autofill/core/browser/autofill_popup_delegate.h" 16 #include "components/autofill/core/browser/autofill_popup_delegate.h"
18 #include "components/autofill/core/browser/popup_item_ids.h" 17 #include "components/autofill/core/browser/popup_item_ids.h"
19 #include "components/autofill/core/browser/suggestion.h" 18 #include "components/autofill/core/browser/suggestion.h"
20 #include "content/public/browser/native_web_keyboard_event.h" 19 #include "content/public/browser/native_web_keyboard_event.h"
21 #include "ui/events/event.h" 20 #include "ui/events/event.h"
22 #include "ui/gfx/canvas.h" 21 #include "ui/gfx/canvas.h"
23 #include "ui/gfx/text_elider.h" 22 #include "ui/gfx/text_elider.h"
24 #include "ui/gfx/text_utils.h" 23 #include "ui/gfx/text_utils.h"
25 24
26 using base::WeakPtr; 25 using base::WeakPtr;
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 if (HasSuggestions()) { 367 if (HasSuggestions()) {
369 delegate_->ClearPreviewedForm(); 368 delegate_->ClearPreviewedForm();
370 UpdateBoundsAndRedrawPopup(); 369 UpdateBoundsAndRedrawPopup();
371 } else { 370 } else {
372 Hide(); 371 Hide();
373 } 372 }
374 373
375 return true; 374 return true;
376 } 375 }
377 376
378 SkColor AutofillPopupControllerImpl::GetBackgroundColorForRow(int index) const { 377 ui::NativeTheme::ColorId
379 if (index == selected_line_) 378 AutofillPopupControllerImpl::GetBackgroundColorIDForRow(int index) const {
380 return kHoveredBackgroundColor; 379 return index == selected_line_ ?
381 380 ui::NativeTheme::kColorId_ResultsTableHoveredBackground :
382 return SK_ColorTRANSPARENT; 381 ui::NativeTheme::kColorId_ResultsTableNormalBackground;
383 } 382 }
384 383
385 int AutofillPopupControllerImpl::selected_line() const { 384 int AutofillPopupControllerImpl::selected_line() const {
386 return selected_line_; 385 return selected_line_;
387 } 386 }
388 387
389 const AutofillPopupLayoutModel& AutofillPopupControllerImpl::layout_model() 388 const AutofillPopupLayoutModel& AutofillPopupControllerImpl::layout_model()
390 const { 389 const {
391 return layout_model_; 390 return layout_model_;
392 } 391 }
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 // Don't clear view_, because otherwise the popup will have to get regenerated 528 // Don't clear view_, because otherwise the popup will have to get regenerated
530 // and this will cause flickering. 529 // and this will cause flickering.
531 suggestions_.clear(); 530 suggestions_.clear();
532 elided_values_.clear(); 531 elided_values_.clear();
533 elided_labels_.clear(); 532 elided_labels_.clear();
534 533
535 selected_line_ = kNoSelection; 534 selected_line_ = kNoSelection;
536 } 535 }
537 536
538 } // namespace autofill 537 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/autofill_popup_controller_impl.h ('k') | chrome/browser/ui/autofill/autofill_popup_layout_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698