OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/app_list/search_result_view.h" | 5 #include "ui/app_list/search_result_view.h" |
6 | 6 |
7 #include "ui/app_list/search_result.h" | 7 #include "ui/app_list/search_result.h" |
8 #include "ui/app_list/search_result_list_view.h" | 8 #include "ui/app_list/search_result_list_view.h" |
9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
10 #include "ui/gfx/font.h" | 10 #include "ui/gfx/font.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 const SkColor kHoverAndPushedColor = SkColorSetARGB(0x05, 0, 0, 0); | 32 const SkColor kHoverAndPushedColor = SkColorSetARGB(0x05, 0, 0, 0); |
33 | 33 |
34 // A non-interactive image view to display result icon. | 34 // A non-interactive image view to display result icon. |
35 class IconView : public views::ImageView { | 35 class IconView : public views::ImageView { |
36 public: | 36 public: |
37 IconView() : ImageView() {} | 37 IconView() : ImageView() {} |
38 virtual ~IconView() {} | 38 virtual ~IconView() {} |
39 | 39 |
40 private: | 40 private: |
41 // views::View overrides: | 41 // views::View overrides: |
42 virtual bool HitTest(const gfx::Point& l) const OVERRIDE { | 42 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE { |
43 return false; | 43 return false; |
44 } | 44 } |
45 | 45 |
46 DISALLOW_COPY_AND_ASSIGN(IconView); | 46 DISALLOW_COPY_AND_ASSIGN(IconView); |
47 }; | 47 }; |
48 | 48 |
49 // Creates a RenderText of given |text| and |styles|. Caller takes ownership | 49 // Creates a RenderText of given |text| and |styles|. Caller takes ownership |
50 // of returned RenderText. | 50 // of returned RenderText. |
51 gfx::RenderText* CreateRenderText(const string16& text, | 51 gfx::RenderText* CreateRenderText(const string16& text, |
52 const app_list::SearchResult::Tags& tags) { | 52 const app_list::SearchResult::Tags& tags) { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 // Scales down big icons but leave small ones unchanged. | 217 // Scales down big icons but leave small ones unchanged. |
218 if (image.width() > kIconDimension || image.height() > kIconDimension) | 218 if (image.width() > kIconDimension || image.height() > kIconDimension) |
219 icon_->SetImageSize(gfx::Size(kIconDimension, kIconDimension)); | 219 icon_->SetImageSize(gfx::Size(kIconDimension, kIconDimension)); |
220 else | 220 else |
221 icon_->ResetImageSize(); | 221 icon_->ResetImageSize(); |
222 | 222 |
223 icon_->SetImage(image); | 223 icon_->SetImage(image); |
224 } | 224 } |
225 | 225 |
226 } // namespace app_list | 226 } // namespace app_list |
OLD | NEW |