| 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_SYSTEM_PALETTE_PALETTE_TRAY_H_ | 5 #ifndef ASH_SYSTEM_PALETTE_PALETTE_TRAY_H_ |
| 6 #define ASH_SYSTEM_PALETTE_PALETTE_TRAY_H_ | 6 #define ASH_SYSTEM_PALETTE_PALETTE_TRAY_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 class PaletteToolManager; | 31 class PaletteToolManager; |
| 32 | 32 |
| 33 // The PaletteTray shows the palette in the bottom area of the screen. This | 33 // The PaletteTray shows the palette in the bottom area of the screen. This |
| 34 // class also controls the lifetime for all of the tools available in the | 34 // class also controls the lifetime for all of the tools available in the |
| 35 // palette. PaletteTray has one instance per-display. It is only made visible if | 35 // palette. PaletteTray has one instance per-display. It is only made visible if |
| 36 // the display is primary and if the device has stylus hardware. | 36 // the display is primary and if the device has stylus hardware. |
| 37 class ASH_EXPORT PaletteTray : public TrayBackgroundView, | 37 class ASH_EXPORT PaletteTray : public TrayBackgroundView, |
| 38 public SessionObserver, | 38 public SessionObserver, |
| 39 public ShellObserver, | 39 public ShellObserver, |
| 40 public PaletteToolManager::Delegate, | 40 public PaletteToolManager::Delegate, |
| 41 public ui::InputDeviceEventObserver, | 41 public ui::InputDeviceEventObserver { |
| 42 public views::TrayBubbleView::Delegate { | |
| 43 public: | 42 public: |
| 44 explicit PaletteTray(Shelf* shelf); | 43 explicit PaletteTray(Shelf* shelf); |
| 45 ~PaletteTray() override; | 44 ~PaletteTray() override; |
| 46 | 45 |
| 47 // ActionableView: | |
| 48 bool PerformAction(const ui::Event& event) override; | |
| 49 | |
| 50 // SessionObserver: | 46 // SessionObserver: |
| 51 void OnSessionStateChanged(session_manager::SessionState state) override; | 47 void OnSessionStateChanged(session_manager::SessionState state) override; |
| 52 | 48 |
| 53 // ShellObserver: | 49 // ShellObserver: |
| 54 void OnLockStateChanged(bool locked) override; | 50 void OnLockStateChanged(bool locked) override; |
| 55 | 51 |
| 56 // TrayBackgroundView: | 52 // TrayBackgroundView: |
| 57 void ClickedOutsideBubble() override; | 53 void ClickedOutsideBubble() override; |
| 58 base::string16 GetAccessibleNameForTray() override; | 54 base::string16 GetAccessibleNameForTray() override; |
| 59 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; | 55 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; |
| 60 void AnchorUpdated() override; | 56 void AnchorUpdated() override; |
| 61 void Initialize() override; | 57 void Initialize() override; |
| 58 bool PerformAction(const ui::Event& event) override; |
| 59 void CloseBubble() override; |
| 60 void ShowBubble() override; |
| 61 views::TrayBubbleView* GetBubbleView() override; |
| 62 | 62 |
| 63 // PaletteToolManager::Delegate: | 63 // PaletteToolManager::Delegate: |
| 64 void HidePalette() override; | 64 void HidePalette() override; |
| 65 void HidePaletteImmediately() override; | 65 void HidePaletteImmediately() override; |
| 66 void RecordPaletteOptionsUsage(PaletteTrayOptions option) override; | 66 void RecordPaletteOptionsUsage(PaletteTrayOptions option) override; |
| 67 void RecordPaletteModeCancellation(PaletteModeCancelType type) override; | 67 void RecordPaletteModeCancellation(PaletteModeCancelType type) override; |
| 68 | 68 |
| 69 // Opens up the palette if it is not already open. Returns true if the palette | |
| 70 // was opened. | |
| 71 bool ShowPalette(); | |
| 72 | |
| 73 // Returns true if the palette tray contains the given point. This is useful | 69 // Returns true if the palette tray contains the given point. This is useful |
| 74 // for determining if an event should be propagated through to the palette. | 70 // for determining if an event should be propagated through to the palette. |
| 75 bool ContainsPointInScreen(const gfx::Point& point); | 71 bool ContainsPointInScreen(const gfx::Point& point); |
| 76 | 72 |
| 77 private: | 73 private: |
| 78 // ui::InputDeviceObserver: | 74 // ui::InputDeviceObserver: |
| 79 void OnTouchscreenDeviceConfigurationChanged() override; | 75 void OnTouchscreenDeviceConfigurationChanged() override; |
| 80 void OnStylusStateChanged(ui::StylusState stylus_state) override; | 76 void OnStylusStateChanged(ui::StylusState stylus_state) override; |
| 81 | 77 |
| 82 // views::TrayBubbleView::Delegate: | 78 // views::TrayBubbleView::Delegate: |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 ScopedSessionObserver scoped_session_observer_; | 124 ScopedSessionObserver scoped_session_observer_; |
| 129 | 125 |
| 130 base::WeakPtrFactory<PaletteTray> weak_factory_; | 126 base::WeakPtrFactory<PaletteTray> weak_factory_; |
| 131 | 127 |
| 132 DISALLOW_COPY_AND_ASSIGN(PaletteTray); | 128 DISALLOW_COPY_AND_ASSIGN(PaletteTray); |
| 133 }; | 129 }; |
| 134 | 130 |
| 135 } // namespace ash | 131 } // namespace ash |
| 136 | 132 |
| 137 #endif // ASH_SYSTEM_PALETTE_PALETTE_TRAY_H_ | 133 #endif // ASH_SYSTEM_PALETTE_PALETTE_TRAY_H_ |
| OLD | NEW |