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