| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ | 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ |
| 6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ | 6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; | 51 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; |
| 52 void SetShelfAlignment(ShelfAlignment alignment) override; | 52 void SetShelfAlignment(ShelfAlignment alignment) override; |
| 53 void AnchorUpdated() override; | 53 void AnchorUpdated() override; |
| 54 | 54 |
| 55 // PaletteToolManager::Delegate: | 55 // PaletteToolManager::Delegate: |
| 56 void HidePalette() override; | 56 void HidePalette() override; |
| 57 | 57 |
| 58 // Returns true if the shelf should not autohide. | 58 // Returns true if the shelf should not autohide. |
| 59 bool ShouldBlockShelfAutoHide() const; | 59 bool ShouldBlockShelfAutoHide() const; |
| 60 | 60 |
| 61 bool OpenBubble(); |
| 62 |
| 61 private: | 63 private: |
| 62 // views::TrayBubbleView::Delegate: | 64 // views::TrayBubbleView::Delegate: |
| 63 void BubbleViewDestroyed() override; | 65 void BubbleViewDestroyed() override; |
| 64 void OnMouseEnteredView() override; | 66 void OnMouseEnteredView() override; |
| 65 void OnMouseExitedView() override; | 67 void OnMouseExitedView() override; |
| 66 base::string16 GetAccessibleNameForBubble() override; | 68 base::string16 GetAccessibleNameForBubble() override; |
| 67 gfx::Rect GetAnchorRect(views::Widget* anchor_widget, | 69 gfx::Rect GetAnchorRect(views::Widget* anchor_widget, |
| 68 AnchorType anchor_type, | 70 AnchorType anchor_type, |
| 69 AnchorAlignment anchor_alignment) const override; | 71 AnchorAlignment anchor_alignment) const override; |
| 70 void OnBeforeBubbleWidgetInit( | 72 void OnBeforeBubbleWidgetInit( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 86 | 88 |
| 87 // Sets the icon to visible if the palette can be used. | 89 // Sets the icon to visible if the palette can be used. |
| 88 void UpdateIconVisibility(); | 90 void UpdateIconVisibility(); |
| 89 | 91 |
| 90 // Called when a stylus inserted or removed event is received. | 92 // Called when a stylus inserted or removed event is received. |
| 91 void OnStylusStateChanged(ui::StylusState stylus_state); | 93 void OnStylusStateChanged(ui::StylusState stylus_state); |
| 92 | 94 |
| 93 // Called when the palette enabled pref has changed. | 95 // Called when the palette enabled pref has changed. |
| 94 void OnPaletteEnabledPrefChanged(bool enabled); | 96 void OnPaletteEnabledPrefChanged(bool enabled); |
| 95 | 97 |
| 96 bool OpenBubble(); | |
| 97 void AddToolsToView(views::View* host); | 98 void AddToolsToView(views::View* host); |
| 98 | 99 |
| 99 std::unique_ptr<PaletteToolManager> palette_tool_manager_; | 100 std::unique_ptr<PaletteToolManager> palette_tool_manager_; |
| 100 std::unique_ptr<TrayBubbleWrapper> bubble_; | 101 std::unique_ptr<TrayBubbleWrapper> bubble_; |
| 101 | 102 |
| 102 // Manages the callback OnPaletteEnabledPrefChanged callback registered to | 103 // Manages the callback OnPaletteEnabledPrefChanged callback registered to |
| 103 // the PaletteDelegate instance. | 104 // the PaletteDelegate instance. |
| 104 std::unique_ptr<PaletteDelegate::EnableListenerSubscription> | 105 std::unique_ptr<PaletteDelegate::EnableListenerSubscription> |
| 105 palette_enabled_subscription_; | 106 palette_enabled_subscription_; |
| 106 | 107 |
| 107 // Weak pointer, will be parented by TrayContainer for its lifetime. | 108 // Weak pointer, will be parented by TrayContainer for its lifetime. |
| 108 views::ImageView* icon_; | 109 views::ImageView* icon_; |
| 109 | 110 |
| 110 base::WeakPtrFactory<PaletteTray> weak_factory_; | 111 base::WeakPtrFactory<PaletteTray> weak_factory_; |
| 111 | 112 |
| 112 DISALLOW_COPY_AND_ASSIGN(PaletteTray); | 113 DISALLOW_COPY_AND_ASSIGN(PaletteTray); |
| 113 }; | 114 }; |
| 114 | 115 |
| 115 } // namespace ash | 116 } // namespace ash |
| 116 | 117 |
| 117 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ | 118 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ |
| OLD | NEW |