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

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

Issue 1522563002: Modernize autofill popup design (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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_layout_model.h" 5 #include "chrome/browser/ui/autofill/autofill_popup_layout_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/browser/ui/autofill/autofill_popup_view.h" 11 #include "chrome/browser/ui/autofill/autofill_popup_view.h"
12 #include "chrome/browser/ui/autofill/popup_constants.h" 12 #include "chrome/browser/ui/autofill/popup_constants.h"
13 #include "components/autofill/core/browser/popup_item_ids.h" 13 #include "components/autofill/core/browser/popup_item_ids.h"
14 #include "components/autofill/core/browser/suggestion.h" 14 #include "components/autofill/core/browser/suggestion.h"
15 #include "components/autofill/core/common/autofill_util.h" 15 #include "components/autofill/core/common/autofill_util.h"
16 #include "grit/components_scaled_resources.h" 16 #include "grit/components_scaled_resources.h"
17 #include "ui/base/resource/resource_bundle.h" 17 #include "ui/base/resource/resource_bundle.h"
18 #include "ui/gfx/geometry/rect_conversions.h" 18 #include "ui/gfx/geometry/rect_conversions.h"
19 19
20 namespace autofill { 20 namespace autofill {
21 21
22 namespace { 22 namespace {
23 23
24 // The vertical height of each row in pixels. 24 // The vertical height of each row in pixels.
25 const size_t kRowHeight = 24; 25 const size_t kRowHeight = 44;
Evan Stade 2016/01/25 23:19:38 I would recommend reusing MenuConfig layout consta
26 26
27 // The vertical height of a separator in pixels. 27 // The vertical height of a separator in pixels.
28 const size_t kSeparatorHeight = 1; 28 const size_t kSeparatorHeight = 1;
29 29
30 const struct { 30 const struct {
31 const char* name; 31 const char* name;
32 int id; 32 int id;
33 } kDataResources[] = { 33 } kDataResources[] = {
34 {"americanExpressCC", IDR_AUTOFILL_CC_AMEX}, 34 {"americanExpressCC", IDR_AUTOFILL_CC_AMEX},
35 {"dinersCC", IDR_AUTOFILL_CC_GENERIC}, 35 {"dinersCC", IDR_AUTOFILL_CC_GENERIC},
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 #endif 171 #endif
172 172
173 return result; 173 return result;
174 } 174 }
175 175
176 const gfx::Rect AutofillPopupLayoutModel::RoundedElementBounds() const { 176 const gfx::Rect AutofillPopupLayoutModel::RoundedElementBounds() const {
177 return gfx::ToEnclosingRect(delegate_->element_bounds()); 177 return gfx::ToEnclosingRect(delegate_->element_bounds());
178 } 178 }
179 179
180 } // namespace autofill 180 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698