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