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" |
11 #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" | 11 #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" |
12 #include "ui/views/controls/label.h" | 12 #include "ui/views/controls/label.h" |
13 | 13 |
14 class Profile; | 14 class Profile; |
15 namespace gfx { | 15 namespace gfx { |
16 class FontList; | 16 class FontList; |
17 class Size; | 17 class Size; |
18 } | 18 } |
19 | 19 |
20 // SelectedKeywordView displays the tab-to-search UI in the location bar view. | 20 // SelectedKeywordView displays the tab-to-search UI in the location bar view. |
21 class SelectedKeywordView : public IconLabelBubbleView { | 21 class SelectedKeywordView : public IconLabelBubbleView { |
22 public: | 22 public: |
23 SelectedKeywordView(const gfx::FontList& font_list, | 23 SelectedKeywordView(const gfx::FontList& font_list, |
24 SkColor text_color, | 24 SkColor text_color, |
25 SkColor parent_background_color, | 25 SkColor parent_background_color, |
26 Profile* profile); | 26 Profile* profile); |
27 ~SelectedKeywordView() override; | 27 ~SelectedKeywordView() override; |
28 | 28 |
| 29 // Resets the icon for this chip to its default (it may have been changed |
| 30 // for an extension). |
| 31 void ResetImage(); |
| 32 |
29 // IconLabelBubbleView: | 33 // IconLabelBubbleView: |
30 gfx::Size GetPreferredSize() const override; | 34 gfx::Size GetPreferredSize() const override; |
31 gfx::Size GetMinimumSize() const override; | 35 gfx::Size GetMinimumSize() const override; |
32 void Layout() override; | 36 void Layout() override; |
33 | 37 |
34 // The current keyword, or an empty string if no keyword is displayed. | 38 // The current keyword, or an empty string if no keyword is displayed. |
35 void SetKeyword(const base::string16& keyword); | 39 void SetKeyword(const base::string16& keyword); |
36 const base::string16& keyword() const { return keyword_; } | 40 const base::string16& keyword() const { return keyword_; } |
37 | 41 |
38 private: | 42 private: |
(...skipping 11 matching lines...) Expand all Loading... |
50 // enough room to display the complete description. | 54 // enough room to display the complete description. |
51 views::Label full_label_; | 55 views::Label full_label_; |
52 views::Label partial_label_; | 56 views::Label partial_label_; |
53 | 57 |
54 Profile* profile_; | 58 Profile* profile_; |
55 | 59 |
56 DISALLOW_COPY_AND_ASSIGN(SelectedKeywordView); | 60 DISALLOW_COPY_AND_ASSIGN(SelectedKeywordView); |
57 }; | 61 }; |
58 | 62 |
59 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SELECTED_KEYWORD_VIEW_H_ | 63 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SELECTED_KEYWORD_VIEW_H_ |
OLD | NEW |