Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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; | |
|
xiyuan
2017/06/21 18:24:00
nit: Move GetTooltipText() with this.
Qiang(Joe) Xu
2017/06/21 18:50:12
Done.
| |
| 64 | |
| 65 views::ImageView* icon() const { return icon_; } | |
| 66 views::ImageView* badge() const { return badge_; } | |
| 67 views::Label* title() const { return title_; } | |
|
xiyuan
2017/06/21 18:24:00
nit: Move accessors after other methods in the sam
| |
| 68 | |
| 62 void SetIcon(const gfx::ImageSkia& icon); | 69 void SetIcon(const gfx::ImageSkia& icon); |
| 63 void SetBadgeIcon(const gfx::ImageSkia& badge_icon); | 70 void SetBadgeIcon(const gfx::ImageSkia& badge_icon); |
| 64 void SetTitle(const base::string16& title); | 71 void SetTitle(const base::string16& title); |
| 65 | 72 |
| 66 private: | 73 private: |
| 67 void UpdateBackgroundColor(); | 74 void UpdateBackgroundColor(); |
| 68 | 75 |
| 69 // Overridden from views::View: | |
| 70 gfx::Size CalculatePreferredSize() const override; | |
| 71 bool GetTooltipText(const gfx::Point& p, | 76 bool GetTooltipText(const gfx::Point& p, |
| 72 base::string16* tooltip) const override; | 77 base::string16* tooltip) const override; |
| 73 | 78 |
| 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_ |
| OLD | NEW |