| 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 "base/memory/weak_ptr.h" |
| 18 #include "ui/events/devices/input_device_manager.h" |
| 17 | 19 |
| 18 namespace views { | 20 namespace views { |
| 19 class ImageView; | 21 class ImageView; |
| 20 class Widget; | 22 class Widget; |
| 21 } | 23 } |
| 22 | 24 |
| 23 namespace ash { | 25 namespace ash { |
| 24 | 26 |
| 25 class TrayBubbleWrapper; | 27 class TrayBubbleWrapper; |
| 26 class PaletteToolManager; | 28 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 | 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 inserted or removed event is received. |
| 91 void OnStylusStateChanged(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_; |
| 93 | 98 |
| 94 // Weak pointer, will be parented by TrayContainer for its lifetime. | 99 // Weak pointer, will be parented by TrayContainer for its lifetime. |
| 95 views::ImageView* icon_; | 100 views::ImageView* icon_; |
| 96 | 101 |
| 102 base::WeakPtrFactory<PaletteTray> weak_factory_; |
| 103 |
| 97 DISALLOW_COPY_AND_ASSIGN(PaletteTray); | 104 DISALLOW_COPY_AND_ASSIGN(PaletteTray); |
| 98 }; | 105 }; |
| 99 | 106 |
| 100 } // namespace ash | 107 } // namespace ash |
| 101 | 108 |
| 102 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ | 109 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ |
| OLD | NEW |