| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // | 27 // |
| 28 // NOTE: This should really be called LocationBarKeywordHintView, but I | 28 // NOTE: This should really be called LocationBarKeywordHintView, but I |
| 29 // couldn't bring myself to use such a long name. | 29 // couldn't bring myself to use such a long name. |
| 30 class KeywordHintView : public views::View { | 30 class KeywordHintView : public views::View { |
| 31 public: | 31 public: |
| 32 explicit KeywordHintView(Profile* profile); | 32 explicit KeywordHintView(Profile* profile); |
| 33 virtual ~KeywordHintView(); | 33 virtual ~KeywordHintView(); |
| 34 | 34 |
| 35 void SetFont(const gfx::Font& font); | 35 void SetFont(const gfx::Font& font); |
| 36 | 36 |
| 37 void SetColor(const SkColor& color); | |
| 38 | |
| 39 void SetKeyword(const string16& keyword); | 37 void SetKeyword(const string16& keyword); |
| 40 string16 keyword() const { return keyword_; } | 38 string16 keyword() const { return keyword_; } |
| 41 | 39 |
| 42 virtual void OnPaint(gfx::Canvas* canvas); | 40 virtual void OnPaint(gfx::Canvas* canvas); |
| 43 virtual gfx::Size GetPreferredSize(); | 41 virtual gfx::Size GetPreferredSize(); |
| 44 // The minimum size is just big enough to show the tab. | 42 // The minimum size is just big enough to show the tab. |
| 45 virtual gfx::Size GetMinimumSize(); | 43 virtual gfx::Size GetMinimumSize(); |
| 46 virtual void Layout(); | 44 virtual void Layout(); |
| 47 | 45 |
| 48 private: | 46 private: |
| 47 views::Label* CreateLabel(); |
| 48 |
| 49 views::Label* leading_label_; | 49 views::Label* leading_label_; |
| 50 views::Label* trailing_label_; | 50 views::Label* trailing_label_; |
| 51 | 51 |
| 52 // The keyword. | 52 // The keyword. |
| 53 string16 keyword_; | 53 string16 keyword_; |
| 54 | 54 |
| 55 Profile* profile_; | 55 Profile* profile_; |
| 56 | 56 |
| 57 DISALLOW_IMPLICIT_CONSTRUCTORS(KeywordHintView); | 57 DISALLOW_IMPLICIT_CONSTRUCTORS(KeywordHintView); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_ | 60 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_KEYWORD_HINT_VIEW_H_ |
| OLD | NEW |