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

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

Issue 2893573004: Simplify some code in c/b/u/views. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | chrome/browser/ui/views/location_bar/keyword_hint_view.cc » ('j') | 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) 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 19 matching lines...) Expand all
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& chip_font_list, 39 const gfx::FontList& chip_font_list,
40 int chip_height,
41 SkColor text_color, 40 SkColor text_color,
42 SkColor background_color); 41 SkColor background_color);
43 ~KeywordHintView() override; 42 ~KeywordHintView() override;
44 43
45 void SetKeyword(const base::string16& keyword); 44 void SetKeyword(const base::string16& keyword);
46 base::string16 keyword() const { return keyword_; } 45 base::string16 keyword() const { return keyword_; }
47 46
48 private: 47 private:
49 // views::View: 48 // views::View:
50 gfx::Size GetPreferredSize() const override; 49 gfx::Size GetPreferredSize() const override;
51 // The minimum size is just big enough to show the tab. 50 // The minimum size is just big enough to show the tab.
52 gfx::Size GetMinimumSize() const override; 51 gfx::Size GetMinimumSize() const override;
53 void Layout() override; 52 void Layout() override;
54 const char* GetClassName() const override; 53 const char* GetClassName() const override;
55 54
56 views::Label* CreateLabel(const gfx::FontList& font_list, 55 views::Label* CreateLabel(const gfx::FontList& font_list,
57 SkColor text_color, 56 SkColor text_color,
58 SkColor background_color); 57 SkColor background_color);
59 58
60 Profile* profile_; 59 Profile* profile_;
61 60
62 views::Label* leading_label_; 61 views::Label* leading_label_;
63 views::Label* chip_view_; 62 views::View* chip_container_;
63 views::Label* chip_label_;
64 views::Label* trailing_label_; 64 views::Label* trailing_label_;
65 65
66 int chip_view_height_;
67
68 base::string16 keyword_; 66 base::string16 keyword_;
69 67
70 DISALLOW_COPY_AND_ASSIGN(KeywordHintView); 68 DISALLOW_COPY_AND_ASSIGN(KeywordHintView);
71 }; 69 };
72 70
73 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_ 71 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/location_bar/keyword_hint_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698