| 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 |
| 11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 12 #include "ash/common/session/session_state_observer.h" | 12 #include "ash/common/session/session_state_observer.h" |
| 13 #include "ash/common/shell_observer.h" | 13 #include "ash/common/shell_observer.h" |
| 14 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" | 14 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" |
| 15 #include "ash/common/system/tray/tray_background_view.h" | 15 #include "ash/common/system/tray/tray_background_view.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "ui/events/devices/input_device_manager.h" |
| 17 | 18 |
| 18 namespace views { | 19 namespace views { |
| 19 class ImageView; | 20 class ImageView; |
| 20 class Widget; | 21 class Widget; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace ash { | 24 namespace ash { |
| 24 | 25 |
| 25 class TrayBubbleWrapper; | 26 class TrayBubbleWrapper; |
| 26 class PaletteToolManager; | 27 class PaletteToolManager; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // Creates a new border for the icon. The padding is determined based on the | 79 // Creates a new border for the icon. The padding is determined based on the |
| 79 // alignment of the shelf. | 80 // alignment of the shelf. |
| 80 void SetIconBorderForShelfAlignment(); | 81 void SetIconBorderForShelfAlignment(); |
| 81 | 82 |
| 82 // Updates the tray icon from the palette tool manager. | 83 // Updates the tray icon from the palette tool manager. |
| 83 void UpdateTrayIcon(); | 84 void UpdateTrayIcon(); |
| 84 | 85 |
| 85 // Sets the icon to visible if the palette can be used. | 86 // Sets the icon to visible if the palette can be used. |
| 86 void UpdateIconVisibility(); | 87 void UpdateIconVisibility(); |
| 87 | 88 |
| 89 // Called when a stylus inserted or removed event is received. |
| 90 void OnStylusStateChanged(ui::StylusState stylus_state); |
| 91 |
| 88 bool OpenBubble(); | 92 bool OpenBubble(); |
| 89 void AddToolsToView(views::View* host); | 93 void AddToolsToView(views::View* host); |
| 90 | 94 |
| 91 std::unique_ptr<PaletteToolManager> palette_tool_manager_; | 95 std::unique_ptr<PaletteToolManager> palette_tool_manager_; |
| 92 std::unique_ptr<TrayBubbleWrapper> bubble_; | 96 std::unique_ptr<TrayBubbleWrapper> bubble_; |
| 93 | 97 |
| 94 // Weak pointer, will be parented by TrayContainer for its lifetime. | 98 // Weak pointer, will be parented by TrayContainer for its lifetime. |
| 95 views::ImageView* icon_; | 99 views::ImageView* icon_; |
| 96 | 100 |
| 97 DISALLOW_COPY_AND_ASSIGN(PaletteTray); | 101 DISALLOW_COPY_AND_ASSIGN(PaletteTray); |
| 98 }; | 102 }; |
| 99 | 103 |
| 100 } // namespace ash | 104 } // namespace ash |
| 101 | 105 |
| 102 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ | 106 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ |
| OLD | NEW |