Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Side by Side Diff: chrome/browser/ui/views/location_bar/selected_keyword_view.h

Issue 2348853004: Remove non-md code in location bar (Views). (Closed)
Patch Set: images Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/macros.h" 11 #include "base/macros.h"
12 #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" 12 #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h"
13 #include "ui/views/controls/label.h" 13 #include "ui/views/controls/label.h"
14 14
15 class Profile; 15 class Profile;
16 namespace gfx { 16 namespace gfx {
17 class FontList; 17 class FontList;
18 class Size; 18 class Size;
19 } 19 }
20 20
21 // SelectedKeywordView displays the tab-to-search UI in the location bar view. 21 // SelectedKeywordView displays the tab-to-search UI in the location bar view.
22 class SelectedKeywordView : public IconLabelBubbleView { 22 class SelectedKeywordView : public IconLabelBubbleView {
23 public: 23 public:
24 SelectedKeywordView(const gfx::FontList& font_list, 24 SelectedKeywordView(const gfx::FontList& font_list,
25 SkColor text_color,
26 SkColor parent_background_color,
27 Profile* profile); 25 Profile* profile);
28 ~SelectedKeywordView() override; 26 ~SelectedKeywordView() override;
29 27
30 // 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
31 // for an extension). 29 // for an extension).
32 void ResetImage(); 30 void ResetImage();
33 31
34 // IconLabelBubbleView: 32 // IconLabelBubbleView:
35 SkColor GetTextColor() const override; 33 SkColor GetTextColor() const override;
36 SkColor GetBorderColor() const override; 34 SkColor GetBorderColor() const override;
37 35
38 // views::View: 36 // views::View:
39 gfx::Size GetPreferredSize() const override; 37 gfx::Size GetPreferredSize() const override;
40 gfx::Size GetMinimumSize() const override; 38 gfx::Size GetMinimumSize() const override;
41 void Layout() override; 39 void Layout() override;
42 40
43 // The current keyword, or an empty string if no keyword is displayed. 41 // The current keyword, or an empty string if no keyword is displayed.
44 void SetKeyword(const base::string16& keyword); 42 void SetKeyword(const base::string16& keyword);
45 const base::string16& keyword() const { return keyword_; } 43 const base::string16& keyword() const { return keyword_; }
46 44
47 private: 45 private:
48 // IconLabelBubbleView: 46 // IconLabelBubbleView:
49 const char* GetClassName() const override; 47 const char* GetClassName() const override;
50 48
51 SkColor text_color_;
52
53 // The keyword we're showing. If empty, no keyword is selected. 49 // The keyword we're showing. If empty, no keyword is selected.
54 // NOTE: we don't cache the TemplateURL as it is possible for it to get 50 // NOTE: we don't cache the TemplateURL as it is possible for it to get
55 // deleted out from under us. 51 // deleted out from under us.
56 base::string16 keyword_; 52 base::string16 keyword_;
57 53
58 // These labels are never visible. They are used to size the view. One 54 // These labels are never visible. They are used to size the view. One
59 // label contains the complete description of the keyword, the second 55 // label contains the complete description of the keyword, the second
60 // contains a truncated version of the description, for if there is not 56 // contains a truncated version of the description, for if there is not
61 // enough room to display the complete description. 57 // enough room to display the complete description.
62 views::Label full_label_; 58 views::Label full_label_;
63 views::Label partial_label_; 59 views::Label partial_label_;
64 60
65 Profile* profile_; 61 Profile* profile_;
66 62
67 DISALLOW_COPY_AND_ASSIGN(SelectedKeywordView); 63 DISALLOW_COPY_AND_ASSIGN(SelectedKeywordView);
68 }; 64 };
69 65
70 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SELECTED_KEYWORD_VIEW_H_ 66 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SELECTED_KEYWORD_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698