Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
|
Peter Kasting
2012/12/17 21:01:00
Nit: I'd leave these two blank lines out.
kuan
2012/12/20 00:26:14
Done.
| |
| 14 namespace gfx { | |
| 15 class Font; | |
| 16 } | |
| 17 | |
| 18 namespace views { | |
| 19 class Label; | |
| 20 } | |
| 21 | |
| 22 // SearchTokenView is used by the location bar view to display a search token to | |
| 23 // the user when the omnibox replaces the url with its query terms. | |
| 24 // Internally SearchTokenView uses a label to render the text, and draws the | |
| 25 // right border that serves as a divider between itself and the icons to its | |
| 26 // right. | |
| 27 class SearchTokenView : public views::View { | |
| 28 public: | |
| 29 explicit SearchTokenView(const LocationBarView* location_bar_view); | |
| 30 virtual ~SearchTokenView(); | |
| 31 | |
| 32 void SetFont(const gfx::Font& font); | |
| 33 | |
| 34 void SetSearchProvider(const string16& search_provider); | |
| 35 | |
| 36 bool HasSearchProvider() const { | |
|
Peter Kasting
2012/12/17 21:01:00
Inline functions must be named unix_hacker()-style
kuan
2012/12/20 00:26:14
Done.
| |
| 37 return !search_provider_.empty(); | |
| 38 } | |
| 39 | |
| 40 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
| 41 virtual void Layout() OVERRIDE; | |
| 42 virtual void OnPaintBorder(gfx::Canvas* canvas) OVERRIDE; | |
| 43 | |
| 44 private: | |
| 45 views::Label* label_; | |
| 46 string16 search_provider_; | |
| 47 SkColor border_color_; | |
| 48 | |
| 49 DISALLOW_IMPLICIT_CONSTRUCTORS(SearchTokenView); | |
|
Peter Kasting
2012/12/17 21:01:00
Nit: This should be DISALLOW_COPY_AND_ASSIGN.
kuan
2012/12/20 00:26:14
Done.
| |
| 50 }; | |
| 51 | |
| 52 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SEARCH_TOKEN_VIEW_H_ | |
| OLD | NEW |