| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 ASH_SYSTEM_TRAY_HOVER_HIGHLIGHT_VIEW_H_ | 5 #ifndef ASH_SYSTEM_TRAY_HOVER_HIGHLIGHT_VIEW_H_ |
| 6 #define ASH_SYSTEM_TRAY_HOVER_HIGHLIGHT_VIEW_H_ | 6 #define ASH_SYSTEM_TRAY_HOVER_HIGHLIGHT_VIEW_H_ |
| 7 | 7 |
| 8 #include "ash/system/tray/actionable_view.h" | 8 #include "ash/system/tray/actionable_view.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 void set_text_default_color(SkColor color) { text_default_color_ = color; } | 56 void set_text_default_color(SkColor color) { text_default_color_ = color; } |
| 57 | 57 |
| 58 views::Label* text_label() { return text_label_; } | 58 views::Label* text_label() { return text_label_; } |
| 59 | 59 |
| 60 bool hover() const { return hover_; } | 60 bool hover() const { return hover_; } |
| 61 | 61 |
| 62 protected: | 62 protected: |
| 63 // Overridden from views::View. | 63 // Overridden from views::View. |
| 64 void GetAccessibleState(ui::AXViewState* state) override; | 64 void GetAccessibleState(ui::AXViewState* state) override; |
| 65 | 65 |
| 66 private: | |
| 67 // Sets the highlighted color on a text label if |hover| is set. | 66 // Sets the highlighted color on a text label if |hover| is set. |
| 68 void SetHoverHighlight(bool hover); | 67 void SetHoverHighlight(bool hover); |
| 69 | 68 |
| 69 private: |
| 70 // Overridden from ActionableView: | 70 // Overridden from ActionableView: |
| 71 bool PerformAction(const ui::Event& event) override; | 71 bool PerformAction(const ui::Event& event) override; |
| 72 | 72 |
| 73 // Overridden from views::View. | 73 // Overridden from views::View. |
| 74 gfx::Size GetPreferredSize() const override; | 74 gfx::Size GetPreferredSize() const override; |
| 75 int GetHeightForWidth(int width) const override; | 75 int GetHeightForWidth(int width) const override; |
| 76 void OnMouseEntered(const ui::MouseEvent& event) override; | 76 void OnMouseEntered(const ui::MouseEvent& event) override; |
| 77 void OnMouseExited(const ui::MouseEvent& event) override; | 77 void OnMouseExited(const ui::MouseEvent& event) override; |
| 78 void OnGestureEvent(ui::GestureEvent* event) override; | 78 void OnGestureEvent(ui::GestureEvent* event) override; |
| 79 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; |
| 79 void OnEnabledChanged() override; | 80 void OnEnabledChanged() override; |
| 80 void OnPaintBackground(gfx::Canvas* canvas) override; | 81 void OnPaintBackground(gfx::Canvas* canvas) override; |
| 81 void OnFocus() override; | 82 void OnFocus() override; |
| 82 | 83 |
| 83 ViewClickListener* listener_; | 84 ViewClickListener* listener_; |
| 84 views::Label* text_label_; | 85 views::Label* text_label_; |
| 85 SkColor highlight_color_; | 86 SkColor highlight_color_; |
| 86 SkColor default_color_; | 87 SkColor default_color_; |
| 87 SkColor text_highlight_color_; | 88 SkColor text_highlight_color_; |
| 88 SkColor text_default_color_; | 89 SkColor text_default_color_; |
| 89 bool hover_; | 90 bool hover_; |
| 90 bool expandable_; | 91 bool expandable_; |
| 91 bool checkable_; | 92 bool checkable_; |
| 92 bool checked_; | 93 bool checked_; |
| 93 | 94 |
| 94 DISALLOW_COPY_AND_ASSIGN(HoverHighlightView); | 95 DISALLOW_COPY_AND_ASSIGN(HoverHighlightView); |
| 95 }; | 96 }; |
| 96 | 97 |
| 97 } // namespace ash | 98 } // namespace ash |
| 98 | 99 |
| 99 #endif // ASH_SYSTEM_TRAY_HOVER_HIGHLIGHT_VIEW_H_ | 100 #endif // ASH_SYSTEM_TRAY_HOVER_HIGHLIGHT_VIEW_H_ |
| OLD | NEW |