| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SELECTED_KEYWORD_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SELECTED_KEYWORD_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SELECTED_KEYWORD_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SELECTED_KEYWORD_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 16 matching lines...) Expand all Loading... |
| 27 ~SelectedKeywordView() override; | 27 ~SelectedKeywordView() override; |
| 28 | 28 |
| 29 // Resets the icon for this chip to its default (it may have been changed | 29 // Resets the icon for this chip to its default (it may have been changed |
| 30 // for an extension). | 30 // for an extension). |
| 31 void ResetImage(); | 31 void ResetImage(); |
| 32 | 32 |
| 33 // IconLabelBubbleView: | 33 // IconLabelBubbleView: |
| 34 gfx::Size GetPreferredSize() const override; | 34 gfx::Size GetPreferredSize() const override; |
| 35 gfx::Size GetMinimumSize() const override; | 35 gfx::Size GetMinimumSize() const override; |
| 36 void Layout() override; | 36 void Layout() override; |
| 37 SkColor GetTextColor() const override; |
| 38 SkColor GetBorderColor() const override; |
| 37 | 39 |
| 38 // The current keyword, or an empty string if no keyword is displayed. | 40 // The current keyword, or an empty string if no keyword is displayed. |
| 39 void SetKeyword(const base::string16& keyword); | 41 void SetKeyword(const base::string16& keyword); |
| 40 const base::string16& keyword() const { return keyword_; } | 42 const base::string16& keyword() const { return keyword_; } |
| 41 | 43 |
| 42 private: | 44 private: |
| 43 // IconLabelBubbleView: | 45 // IconLabelBubbleView: |
| 44 const char* GetClassName() const override; | 46 const char* GetClassName() const override; |
| 45 | 47 |
| 46 // The keyword we're showing. If empty, no keyword is selected. | 48 // The keyword we're showing. If empty, no keyword is selected. |
| 47 // NOTE: we don't cache the TemplateURL as it is possible for it to get | 49 // NOTE: we don't cache the TemplateURL as it is possible for it to get |
| 48 // deleted out from under us. | 50 // deleted out from under us. |
| 49 base::string16 keyword_; | 51 base::string16 keyword_; |
| 50 | 52 |
| 51 // These labels are never visible. They are used to size the view. One | 53 // These labels are never visible. They are used to size the view. One |
| 52 // label contains the complete description of the keyword, the second | 54 // label contains the complete description of the keyword, the second |
| 53 // contains a truncated version of the description, for if there is not | 55 // contains a truncated version of the description, for if there is not |
| 54 // enough room to display the complete description. | 56 // enough room to display the complete description. |
| 55 views::Label full_label_; | 57 views::Label full_label_; |
| 56 views::Label partial_label_; | 58 views::Label partial_label_; |
| 57 | 59 |
| 58 Profile* profile_; | 60 Profile* profile_; |
| 59 | 61 |
| 60 DISALLOW_COPY_AND_ASSIGN(SelectedKeywordView); | 62 DISALLOW_COPY_AND_ASSIGN(SelectedKeywordView); |
| 61 }; | 63 }; |
| 62 | 64 |
| 63 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SELECTED_KEYWORD_VIEW_H_ | 65 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SELECTED_KEYWORD_VIEW_H_ |
| OLD | NEW |