OLD | NEW |
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 23 matching lines...) Expand all Loading... |
34 public: | 34 public: |
35 KeywordHintView(Profile* profile, | 35 KeywordHintView(Profile* profile, |
36 const gfx::FontList& font_list, | 36 const gfx::FontList& font_list, |
37 SkColor text_color, | 37 SkColor text_color, |
38 SkColor background_color); | 38 SkColor background_color); |
39 ~KeywordHintView() override; | 39 ~KeywordHintView() override; |
40 | 40 |
41 void SetKeyword(const base::string16& keyword); | 41 void SetKeyword(const base::string16& keyword); |
42 base::string16 keyword() const { return keyword_; } | 42 base::string16 keyword() const { return keyword_; } |
43 | 43 |
| 44 private: |
| 45 // views::View: |
44 gfx::Size GetPreferredSize() const override; | 46 gfx::Size GetPreferredSize() const override; |
45 // The minimum size is just big enough to show the tab. | 47 // The minimum size is just big enough to show the tab. |
46 gfx::Size GetMinimumSize() const override; | 48 gfx::Size GetMinimumSize() const override; |
47 void Layout() override; | 49 void Layout() override; |
| 50 const char* GetClassName() const override; |
48 | 51 |
49 private: | |
50 views::Label* CreateLabel(const gfx::FontList& font_list, | 52 views::Label* CreateLabel(const gfx::FontList& font_list, |
51 SkColor text_color, | 53 SkColor text_color, |
52 SkColor background_color); | 54 SkColor background_color); |
53 | 55 |
54 Profile* profile_; | 56 Profile* profile_; |
55 views::Label* leading_label_; | 57 views::Label* leading_label_; |
56 views::ImageView* tab_image_; | 58 views::ImageView* tab_image_; |
57 views::Label* trailing_label_; | 59 views::Label* trailing_label_; |
58 base::string16 keyword_; | 60 base::string16 keyword_; |
59 | 61 |
60 DISALLOW_COPY_AND_ASSIGN(KeywordHintView); | 62 DISALLOW_COPY_AND_ASSIGN(KeywordHintView); |
61 }; | 63 }; |
62 | 64 |
63 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_ | 65 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_ |
OLD | NEW |