| Index: chrome/browser/ui/views/location_bar/search_token_view.h
|
| diff --git a/chrome/browser/ui/views/location_bar/search_token_view.h b/chrome/browser/ui/views/location_bar/search_token_view.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7e890fd814daeed6ed4af0d5fe5679bb51179fae
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/views/location_bar/search_token_view.h
|
| @@ -0,0 +1,55 @@
|
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SEARCH_TOKEN_VIEW_H_
|
| +#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SEARCH_TOKEN_VIEW_H_
|
| +
|
| +#include "base/compiler_specific.h"
|
| +#include "ui/gfx/size.h"
|
| +#include "ui/views/view.h"
|
| +
|
| +namespace gfx {
|
| +class Font;
|
| +}
|
| +namespace views {
|
| +class Label;
|
| +}
|
| +
|
| +// SearchTokenView is used by the location bar view to display a search token to
|
| +// the user when the omnibox replaces the url with its query terms.
|
| +// Internally SearchTokenView uses a label to render the text.
|
| +// right.
|
| +class SearchTokenView : public views::View {
|
| + public:
|
| + SearchTokenView();
|
| + virtual ~SearchTokenView();
|
| +
|
| + void SetFont(const gfx::Font& font);
|
| +
|
| + void SetBackgroundColor(SkColor color);
|
| +
|
| + void SetForegroundColor(SkColor color);
|
| +
|
| + // Set the search provider.
|
| + // If |search_provider| is empty, this decoration is removed.
|
| + void SetSearchProvider(const string16& search_provider);
|
| +
|
| + bool has_search_provider() const {
|
| + return !search_provider_.empty();
|
| + }
|
| +
|
| + virtual gfx::Size GetPreferredSize() OVERRIDE;
|
| + virtual void Layout() OVERRIDE;
|
| +
|
| + protected:
|
| + virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
|
| +
|
| + private:
|
| + views::Label* label_;
|
| + string16 search_provider_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(SearchTokenView);
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SEARCH_TOKEN_VIEW_H_
|
|
|