| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // SessionStateObserver: | 43 // SessionStateObserver: |
| 44 void SessionStateChanged(SessionStateDelegate::SessionState state) override; | 44 void SessionStateChanged(SessionStateDelegate::SessionState state) override; |
| 45 | 45 |
| 46 // TrayBackgroundView: | 46 // TrayBackgroundView: |
| 47 void ClickedOutsideBubble() override; | 47 void ClickedOutsideBubble() override; |
| 48 base::string16 GetAccessibleNameForTray() override; | 48 base::string16 GetAccessibleNameForTray() override; |
| 49 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; | 49 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; |
| 50 void SetShelfAlignment(ShelfAlignment alignment) override; | 50 void SetShelfAlignment(ShelfAlignment alignment) override; |
| 51 void AnchorUpdated() override; | 51 void AnchorUpdated() override; |
| 52 | 52 |
| 53 // PaletteToolManager::Delegate: |
| 54 void HidePalette() override; |
| 55 |
| 53 private: | 56 private: |
| 54 // views::TrayBubbleView::Delegate: | 57 // views::TrayBubbleView::Delegate: |
| 55 void BubbleViewDestroyed() override; | 58 void BubbleViewDestroyed() override; |
| 56 void OnMouseEnteredView() override; | 59 void OnMouseEnteredView() override; |
| 57 void OnMouseExitedView() override; | 60 void OnMouseExitedView() override; |
| 58 base::string16 GetAccessibleNameForBubble() override; | 61 base::string16 GetAccessibleNameForBubble() override; |
| 59 gfx::Rect GetAnchorRect(views::Widget* anchor_widget, | 62 gfx::Rect GetAnchorRect(views::Widget* anchor_widget, |
| 60 AnchorType anchor_type, | 63 AnchorType anchor_type, |
| 61 AnchorAlignment anchor_alignment) const override; | 64 AnchorAlignment anchor_alignment) const override; |
| 62 void OnBeforeBubbleWidgetInit( | 65 void OnBeforeBubbleWidgetInit( |
| 63 views::Widget* anchor_widget, | 66 views::Widget* anchor_widget, |
| 64 views::Widget* bubble_widget, | 67 views::Widget* bubble_widget, |
| 65 views::Widget::InitParams* params) const override; | 68 views::Widget::InitParams* params) const override; |
| 66 void HideBubble(const views::TrayBubbleView* bubble_view) override; | 69 void HideBubble(const views::TrayBubbleView* bubble_view) override; |
| 67 | 70 |
| 68 // PaletteToolManager::Delegate: | 71 // PaletteToolManager::Delegate: |
| 69 void HidePalette() override; | |
| 70 void OnActiveToolChanged() override; | 72 void OnActiveToolChanged() override; |
| 71 WmWindow* GetWindow() override; | 73 WmWindow* GetWindow() override; |
| 72 | 74 |
| 73 // Creates a new border for the icon. The padding is determined based on the | 75 // Creates a new border for the icon. The padding is determined based on the |
| 74 // alignment of the shelf. | 76 // alignment of the shelf. |
| 75 void SetIconBorderForShelfAlignment(); | 77 void SetIconBorderForShelfAlignment(); |
| 76 | 78 |
| 77 // Updates the tray icon from the palette tool manager. | 79 // Updates the tray icon from the palette tool manager. |
| 78 void UpdateTrayIcon(); | 80 void UpdateTrayIcon(); |
| 79 | 81 |
| 80 // Sets the icon to visible if the palette can be used. | 82 // Sets the icon to visible if the palette can be used. |
| 81 void UpdateIconVisibility(); | 83 void UpdateIconVisibility(); |
| 82 | 84 |
| 83 bool OpenBubble(); | 85 bool OpenBubble(); |
| 84 void AddToolsToView(views::View* host); | 86 void AddToolsToView(views::View* host); |
| 85 | 87 |
| 86 std::unique_ptr<PaletteToolManager> palette_tool_manager_; | 88 std::unique_ptr<PaletteToolManager> palette_tool_manager_; |
| 87 std::unique_ptr<TrayBubbleWrapper> bubble_; | 89 std::unique_ptr<TrayBubbleWrapper> bubble_; |
| 88 | 90 |
| 89 // Weak pointer, will be parented by TrayContainer for its lifetime. | 91 // Weak pointer, will be parented by TrayContainer for its lifetime. |
| 90 views::ImageView* icon_; | 92 views::ImageView* icon_; |
| 91 | 93 |
| 92 DISALLOW_COPY_AND_ASSIGN(PaletteTray); | 94 DISALLOW_COPY_AND_ASSIGN(PaletteTray); |
| 93 }; | 95 }; |
| 94 | 96 |
| 95 } // namespace ash | 97 } // namespace ash |
| 96 | 98 |
| 97 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ | 99 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ |
| OLD | NEW |