Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: ui/app_list/views/tile_item_view.h

Issue 2952823002: cros: Make SearchResultTileItemView layout per DisplayType customized (Closed)
Patch Set: nits Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/app_list/views/search_result_tile_item_view.cc ('k') | ui/app_list/views/tile_item_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef UI_APP_LIST_VIEWS_TILE_ITEM_VIEW_H_ 5 #ifndef UI_APP_LIST_VIEWS_TILE_ITEM_VIEW_H_
6 #define UI_APP_LIST_VIEWS_TILE_ITEM_VIEW_H_ 6 #define UI_APP_LIST_VIEWS_TILE_ITEM_VIEW_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "third_party/skia/include/core/SkColor.h" 10 #include "third_party/skia/include/core/SkColor.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 void StateChanged(ButtonState old_state) override; 52 void StateChanged(ButtonState old_state) override;
53 53
54 // Overridden from views::View: 54 // Overridden from views::View:
55 void Layout() override; 55 void Layout() override;
56 const char* GetClassName() const override; 56 const char* GetClassName() const override;
57 57
58 // Overridden from ImageShadowAnimator::Delegate: 58 // Overridden from ImageShadowAnimator::Delegate:
59 void ImageShadowAnimationProgressed(ImageShadowAnimator* animator) override; 59 void ImageShadowAnimationProgressed(ImageShadowAnimator* animator) override;
60 60
61 protected: 61 protected:
62 // Overridden from views::View:
63 gfx::Size CalculatePreferredSize() const override;
64 bool GetTooltipText(const gfx::Point& p,
65 base::string16* tooltip) const override;
66
67 views::ImageView* icon() const { return icon_; }
62 void SetIcon(const gfx::ImageSkia& icon); 68 void SetIcon(const gfx::ImageSkia& icon);
69
70 views::ImageView* badge() const { return badge_; }
63 void SetBadgeIcon(const gfx::ImageSkia& badge_icon); 71 void SetBadgeIcon(const gfx::ImageSkia& badge_icon);
72
73 views::Label* title() const { return title_; }
64 void SetTitle(const base::string16& title); 74 void SetTitle(const base::string16& title);
65 75
66 private: 76 private:
67 void UpdateBackgroundColor(); 77 void UpdateBackgroundColor();
68 78
69 // Overridden from views::View:
70 gfx::Size CalculatePreferredSize() const override;
71 bool GetTooltipText(const gfx::Point& p,
72 base::string16* tooltip) const override;
73
74 SkColor parent_background_color_; 79 SkColor parent_background_color_;
75 std::unique_ptr<ImageShadowAnimator> image_shadow_animator_; 80 std::unique_ptr<ImageShadowAnimator> image_shadow_animator_;
76 81
77 views::ImageView* icon_; // Owned by views hierarchy. 82 views::ImageView* icon_; // Owned by views hierarchy.
78 views::ImageView* badge_; // Owned by views hierarchy. 83 views::ImageView* badge_; // Owned by views hierarchy.
79 views::Label* title_; // Owned by views hierarchy. 84 views::Label* title_; // Owned by views hierarchy.
80 85
81 bool selected_ = false; 86 bool selected_ = false;
82 87
83 DISALLOW_COPY_AND_ASSIGN(TileItemView); 88 DISALLOW_COPY_AND_ASSIGN(TileItemView);
84 }; 89 };
85 90
86 } // namespace app_list 91 } // namespace app_list
87 92
88 #endif // UI_APP_LIST_VIEWS_TILE_ITEM_VIEW_H_ 93 #endif // UI_APP_LIST_VIEWS_TILE_ITEM_VIEW_H_
OLDNEW
« no previous file with comments | « ui/app_list/views/search_result_tile_item_view.cc ('k') | ui/app_list/views/tile_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698