Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / ui / views / location_bar / selected_keyword_view.h
blob1be64e836e0eb33df5350e79733277aee9792f17
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SELECTED_KEYWORD_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SELECTED_KEYWORD_VIEW_H_
8 #include <string>
10 #include "base/compiler_specific.h"
11 #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h"
12 #include "ui/views/controls/label.h"
14 class Profile;
15 namespace gfx {
16 class FontList;
17 class Size;
20 // SelectedKeywordView displays the tab-to-search UI in the location bar view.
21 class SelectedKeywordView : public IconLabelBubbleView {
22 public:
23 SelectedKeywordView(const gfx::FontList& font_list,
24 SkColor text_color,
25 SkColor parent_background_color,
26 Profile* profile);
27 ~SelectedKeywordView() override;
29 // IconLabelBubbleView:
30 gfx::Size GetPreferredSize() const override;
31 gfx::Size GetMinimumSize() const override;
32 void Layout() override;
34 // The current keyword, or an empty string if no keyword is displayed.
35 void SetKeyword(const base::string16& keyword);
36 const base::string16& keyword() const { return keyword_; }
38 private:
39 // IconLabelBubbleView:
40 const char* GetClassName() const override;
42 // The keyword we're showing. If empty, no keyword is selected.
43 // NOTE: we don't cache the TemplateURL as it is possible for it to get
44 // deleted out from under us.
45 base::string16 keyword_;
47 // These labels are never visible. They are used to size the view. One
48 // label contains the complete description of the keyword, the second
49 // contains a truncated version of the description, for if there is not
50 // enough room to display the complete description.
51 views::Label full_label_;
52 views::Label partial_label_;
54 Profile* profile_;
56 DISALLOW_COPY_AND_ASSIGN(SelectedKeywordView);
59 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SELECTED_KEYWORD_VIEW_H_