Chromium Code Reviews| Index: chrome/browser/ui/views/omnibox/omnibox_result_view.h |
| diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.h b/chrome/browser/ui/views/omnibox/omnibox_result_view.h |
| index 4ce5c993b479b5f75f10e3a0526c12e4f9688cae..9c6b29ac8d994c078493b08374e6304477c62808 100644 |
| --- a/chrome/browser/ui/views/omnibox/omnibox_result_view.h |
| +++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.h |
| @@ -8,6 +8,7 @@ |
| #include <vector> |
| #include "base/gtest_prod_util.h" |
| +#include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h" |
| #include "components/omnibox/autocomplete_match.h" |
| #include "third_party/skia/include/core/SkColor.h" |
| #include "ui/gfx/animation/animation_delegate.h" |
| @@ -75,6 +76,9 @@ class OmniboxResultView : public views::View, |
| // Returns the display width required for the match contents. |
| int GetMatchContentsWidth() const; |
| + // Store the image in a local data member and schedule a repaint. |
|
Peter Kasting
2015/03/05 00:33:43
Nit: Stores/schedules
dschuyler
2015/03/05 18:31:04
Done.
|
| + void SetAnswerImage(gfx::ImageSkia image); |
|
Peter Kasting
2015/03/05 00:33:43
const &?
dschuyler
2015/03/05 18:31:04
Both by-value and by-reference are used for ImageS
|
| + |
| protected: |
| // Paints the given |match| using the RenderText instances |contents| and |
| // |description| at offset |x| in the bounds of this view. |
| @@ -163,6 +167,7 @@ class OmniboxResultView : public views::View, |
| size_t model_index_; |
| LocationBarView* location_bar_view_; |
| + BitmapFetcherService* image_service_; |
|
Peter Kasting
2015/03/05 00:33:43
Nit: May want to comment that this can be null whi
dschuyler
2015/03/05 18:31:04
Done.
|
| const gfx::FontList font_list_; |
| int font_height_; |
| @@ -181,6 +186,11 @@ class OmniboxResultView : public views::View, |
| scoped_ptr<gfx::SlideAnimation> animation_; |
| + // If the answer has an icon, these control the fetching and updating |
| + // of the icon. |
| + BitmapFetcherService::RequestId request_id_; |
| + gfx::ImageSkia answer_image_; |
| + |
| // We preserve these RenderTexts so that we won't recreate them on every call |
| // to GetMatchContentsWidth() or OnPaint(). |
| mutable scoped_ptr<gfx::RenderText> contents_rendertext_; |
| @@ -191,6 +201,8 @@ class OmniboxResultView : public views::View, |
| mutable int separator_width_; |
| + base::WeakPtrFactory<OmniboxResultView> weak_ptr_factory_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); |
| }; |