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

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

Issue 11418229: alternate ntp: implement right-aligned search token (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-impl based on philippe's new layout design Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SEARCH_TOKEN_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SEARCH_TOKEN_VIEW_H_
7
8 #include "base/compiler_specific.h"
9 #include "ui/gfx/size.h"
10 #include "ui/views/view.h"
11
12 class LocationBarView;
13 namespace gfx {
14 class Font;
15 }
16 namespace views {
17 class Label;
18 }
19
20 // SearchTokenView is used by the location bar view to display a search token to
21 // the user when the omnibox replaces the url with its query terms.
22 // Internally SearchTokenView uses a label to render the text, and draws the
23 // right border that serves as a divider between itself and the icons to its
24 // right.
25 class SearchTokenView : public views::View {
26 public:
27 explicit SearchTokenView(const LocationBarView* location_bar_view);
28 virtual ~SearchTokenView();
29
30 void SetFont(const gfx::Font& font);
31
32 void SetBackgroundColor(SkColor color);
33
34 void SetForegroundColor(SkColor color);
35
36 void SetSearchProvider(const string16& search_provider);
beaudoin 2013/01/07 17:27:53 Comment that setting an empty string will remove t
kuan 2013/01/09 19:52:58 Done.
37
38 bool has_search_provider() const {
39 return !search_provider_.empty();
40 }
41
42 virtual gfx::Size GetPreferredSize() OVERRIDE;
43 virtual void Layout() OVERRIDE;
44 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
45
46 private:
47 views::Label* label_;
48 string16 search_provider_;
49 SkColor border_color_;
50
51 DISALLOW_COPY_AND_ASSIGN(SearchTokenView);
52 };
53
54 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SEARCH_TOKEN_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698