| OLD | NEW |
| (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_ |
| OLD | NEW |