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

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: impl new design to handle separator in layout system 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) 2013 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 namespace gfx {
13 class Font;
14 }
15 namespace views {
16 class Label;
17 }
18
19 // SearchTokenView is used by the location bar view to display a search token to
20 // the user when the omnibox replaces the url with its query terms.
21 // Internally SearchTokenView uses a label to render the text.
22 // right.
23 class SearchTokenView : public views::View {
24 public:
25 SearchTokenView();
26 virtual ~SearchTokenView();
27
28 void SetFont(const gfx::Font& font);
29
30 void SetBackgroundColor(SkColor color);
31
32 void SetForegroundColor(SkColor color);
33
34 // Set the search provider.
35 // If |search_provider| is empty, this decoration is removed.
36 void SetSearchProvider(const string16& search_provider);
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
45 protected:
46 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
47
48 private:
49 views::Label* label_;
50 string16 search_provider_;
51
52 DISALLOW_COPY_AND_ASSIGN(SearchTokenView);
53 };
54
55 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SEARCH_TOKEN_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698