| 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 |
| 26 class EjectController; |
| 25 class TrayBubbleWrapper; | 27 class TrayBubbleWrapper; |
| 26 class PaletteToolManager; | 28 class PaletteToolManager; |
| 27 | 29 |
| 28 // The PaletteTray shows the palette in the bottom area of the screen. This | 30 // The PaletteTray shows the palette in the bottom area of the screen. This |
| 29 // class also controls the lifetime for all of the tools available in the | 31 // class also controls the lifetime for all of the tools available in the |
| 30 // palette. | 32 // palette. |
| 31 class ASH_EXPORT PaletteTray : public TrayBackgroundView, | 33 class ASH_EXPORT PaletteTray : public TrayBackgroundView, |
| 32 public SessionStateObserver, | 34 public SessionStateObserver, |
| 33 public ShellObserver, | 35 public ShellObserver, |
| 34 public PaletteToolManager::Delegate, | 36 public PaletteToolManager::Delegate, |
| (...skipping 43 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 | 80 // Creates a new border for the icon. The padding is determined based on the |
| 79 // alignment of the shelf. | 81 // alignment of the shelf. |
| 80 void SetIconBorderForShelfAlignment(); | 82 void SetIconBorderForShelfAlignment(); |
| 81 | 83 |
| 82 // Updates the tray icon from the palette tool manager. | 84 // Updates the tray icon from the palette tool manager. |
| 83 void UpdateTrayIcon(); | 85 void UpdateTrayIcon(); |
| 84 | 86 |
| 85 // Sets the icon to visible if the palette can be used. | 87 // Sets the icon to visible if the palette can be used. |
| 86 void UpdateIconVisibility(); | 88 void UpdateIconVisibility(); |
| 87 | 89 |
| 90 // Called when a stylus eject event is received. |
| 91 void OnStylusEject(ui::StylusState stylus_state); |
| 92 |
| 88 bool OpenBubble(); | 93 bool OpenBubble(); |
| 89 void AddToolsToView(views::View* host); | 94 void AddToolsToView(views::View* host); |
| 90 | 95 |
| 91 std::unique_ptr<PaletteToolManager> palette_tool_manager_; | 96 std::unique_ptr<PaletteToolManager> palette_tool_manager_; |
| 92 std::unique_ptr<TrayBubbleWrapper> bubble_; | 97 std::unique_ptr<TrayBubbleWrapper> bubble_; |
| 98 std::unique_ptr<EjectController> eject_controller_; |
| 93 | 99 |
| 94 // Weak pointer, will be parented by TrayContainer for its lifetime. | 100 // Weak pointer, will be parented by TrayContainer for its lifetime. |
| 95 views::ImageView* icon_; | 101 views::ImageView* icon_; |
| 96 | 102 |
| 97 DISALLOW_COPY_AND_ASSIGN(PaletteTray); | 103 DISALLOW_COPY_AND_ASSIGN(PaletteTray); |
| 98 }; | 104 }; |
| 99 | 105 |
| 100 } // namespace ash | 106 } // namespace ash |
| 101 | 107 |
| 102 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ | 108 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ |
| OLD | NEW |