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

Side by Side Diff: chrome/browser/ui/views/location_bar/keyword_hint_view.h

Issue 2803693007: Adjust appearance of omnibox keyword hint view for on-screen keyboards. (Closed)
Patch Set: self review Created 3 years, 8 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 18 matching lines...) Expand all
29 // Internally KeywordHintView uses two labels to render the text, and draws 29 // Internally KeywordHintView uses two labels to render the text, and draws
30 // the tab image itself. 30 // the tab image itself.
31 // 31 //
32 // NOTE: This should really be called LocationBarKeywordHintView, but I 32 // NOTE: This should really be called LocationBarKeywordHintView, but I
33 // couldn't bring myself to use such a long name. 33 // couldn't bring myself to use such a long name.
34 class KeywordHintView : public views::CustomButton { 34 class KeywordHintView : public views::CustomButton {
35 public: 35 public:
36 KeywordHintView(views::ButtonListener* listener, 36 KeywordHintView(views::ButtonListener* listener,
37 Profile* profile, 37 Profile* profile,
38 const gfx::FontList& font_list, 38 const gfx::FontList& font_list,
39 const gfx::FontList& bubble_font_list, 39 const gfx::FontList& chip_font_list,
40 int tab_key_height, 40 int chip_height,
41 SkColor text_color, 41 SkColor text_color,
42 SkColor background_color); 42 SkColor background_color);
43 ~KeywordHintView() override; 43 ~KeywordHintView() override;
44 44
45 void SetKeyword(const base::string16& keyword); 45 void SetKeyword(const base::string16& keyword);
46 base::string16 keyword() const { return keyword_; } 46 base::string16 keyword() const { return keyword_; }
47 47
48 private: 48 private:
49 // views::View: 49 // views::View:
50 gfx::Size GetPreferredSize() const override; 50 gfx::Size GetPreferredSize() const override;
51 // The minimum size is just big enough to show the tab. 51 // The minimum size is just big enough to show the tab.
52 gfx::Size GetMinimumSize() const override; 52 gfx::Size GetMinimumSize() const override;
53 void Layout() override; 53 void Layout() override;
54 const char* GetClassName() const override; 54 const char* GetClassName() const override;
55 55
56 views::Label* CreateLabel(const gfx::FontList& font_list, 56 views::Label* CreateLabel(const gfx::FontList& font_list,
57 SkColor text_color, 57 SkColor text_color,
58 SkColor background_color); 58 SkColor background_color);
59 59
60 Profile* profile_; 60 Profile* profile_;
61 61
62 views::Label* leading_label_; 62 views::Label* leading_label_;
63 views::View* tab_key_view_; 63 views::Label* chip_view_;
64 views::Label* trailing_label_; 64 views::Label* trailing_label_;
65 65
66 // Height of the tab key view. 66 // Height of the chip/chip view.
Peter Kasting 2017/04/07 18:14:15 Nit: Is this a typo, or is "chip" different from "
Evan Stade 2017/04/08 00:07:22 yea that's a typo. Should be able to just remove i
67 int tab_key_height_; 67 int chip_view_height_;
68 68
69 base::string16 keyword_; 69 base::string16 keyword_;
70 70
71 DISALLOW_COPY_AND_ASSIGN(KeywordHintView); 71 DISALLOW_COPY_AND_ASSIGN(KeywordHintView);
72 }; 72 };
73 73
74 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_ 74 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698