| 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 26 matching lines...) Expand all Loading... |
| 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 { | 42 public views::TrayBubbleView::Delegate { |
| 43 public: | 43 public: |
| 44 explicit PaletteTray(Shelf* shelf); | 44 explicit PaletteTray(Shelf* shelf); |
| 45 ~PaletteTray() override; | 45 ~PaletteTray() override; |
| 46 | 46 |
| 47 // ActionableView: | |
| 48 bool PerformAction(const ui::Event& event) override; | |
| 49 | |
| 50 // SessionObserver: | 47 // SessionObserver: |
| 51 void OnSessionStateChanged(session_manager::SessionState state) override; | 48 void OnSessionStateChanged(session_manager::SessionState state) override; |
| 52 | 49 |
| 53 // ShellObserver: | 50 // ShellObserver: |
| 54 void OnLockStateChanged(bool locked) override; | 51 void OnLockStateChanged(bool locked) override; |
| 55 | 52 |
| 56 // TrayBackgroundView: | 53 // TrayBackgroundView: |
| 57 void ClickedOutsideBubble() override; | 54 void ClickedOutsideBubble() override; |
| 58 base::string16 GetAccessibleNameForTray() override; | 55 base::string16 GetAccessibleNameForTray() override; |
| 59 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; | 56 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; |
| 60 void AnchorUpdated() override; | 57 void AnchorUpdated() override; |
| 61 void Initialize() override; | 58 void Initialize() override; |
| 59 bool PerformAction(const ui::Event& event) override; |
| 60 void CloseBubble() override; |
| 61 void ShowBubble() override; |
| 62 views::TrayBubbleView* GetBubbleView() override; |
| 63 void OnGestureEvent(ui::GestureEvent* event) override; |
| 62 | 64 |
| 63 // PaletteToolManager::Delegate: | 65 // PaletteToolManager::Delegate: |
| 64 void HidePalette() override; | 66 void HidePalette() override; |
| 65 void HidePaletteImmediately() override; | 67 void HidePaletteImmediately() override; |
| 66 void RecordPaletteOptionsUsage(PaletteTrayOptions option) override; | 68 void RecordPaletteOptionsUsage(PaletteTrayOptions option) override; |
| 67 void RecordPaletteModeCancellation(PaletteModeCancelType type) override; | 69 void RecordPaletteModeCancellation(PaletteModeCancelType type) override; |
| 68 | 70 |
| 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 | 71 // 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. | 72 // for determining if an event should be propagated through to the palette. |
| 75 bool ContainsPointInScreen(const gfx::Point& point); | 73 bool ContainsPointInScreen(const gfx::Point& point); |
| 76 | 74 |
| 77 private: | 75 private: |
| 78 // ui::InputDeviceObserver: | 76 // ui::InputDeviceObserver: |
| 79 void OnTouchscreenDeviceConfigurationChanged() override; | 77 void OnTouchscreenDeviceConfigurationChanged() override; |
| 80 void OnStylusStateChanged(ui::StylusState stylus_state) override; | 78 void OnStylusStateChanged(ui::StylusState stylus_state) override; |
| 81 | 79 |
| 82 // views::TrayBubbleView::Delegate: | 80 // views::TrayBubbleView::Delegate: |
| 83 void BubbleViewDestroyed() override; | 81 void BubbleViewDestroyed() override; |
| 84 void OnMouseEnteredView() override; | 82 void OnMouseEnteredView() override; |
| 85 void OnMouseExitedView() override; | 83 void OnMouseExitedView() override; |
| 86 void RegisterAccelerators(const std::vector<ui::Accelerator>& accelerators, | 84 void RegisterAccelerators(const std::vector<ui::Accelerator>& accelerators, |
| 87 views::TrayBubbleView* tray_bubble_view) override; | 85 views::TrayBubbleView* tray_bubble_view) override; |
| 88 void UnregisterAllAccelerators( | 86 void UnregisterAllAccelerators( |
| 89 views::TrayBubbleView* tray_bubble_view) override; | 87 views::TrayBubbleView* tray_bubble_view) override; |
| 90 base::string16 GetAccessibleNameForBubble() override; | 88 base::string16 GetAccessibleNameForBubble() override; |
| 91 bool ShouldEnableExtraKeyboardAccessibility() override; | 89 bool ShouldEnableExtraKeyboardAccessibility() override; |
| 92 void HideBubble(const views::TrayBubbleView* bubble_view) override; | 90 void HideBubble(const views::TrayBubbleView* bubble_view) override; |
| 91 bool ProcessGestureEventForBubble(ui::GestureEvent* event) override; |
| 93 | 92 |
| 94 // PaletteToolManager::Delegate: | 93 // PaletteToolManager::Delegate: |
| 95 void OnActiveToolChanged() override; | 94 void OnActiveToolChanged() override; |
| 96 aura::Window* GetWindow() override; | 95 aura::Window* GetWindow() override; |
| 97 | 96 |
| 98 // Updates the tray icon from the palette tool manager. | 97 // Updates the tray icon from the palette tool manager. |
| 99 void UpdateTrayIcon(); | 98 void UpdateTrayIcon(); |
| 100 | 99 |
| 101 // Sets the icon to visible if the palette can be used. | 100 // Sets the icon to visible if the palette can be used. |
| 102 void UpdateIconVisibility(); | 101 void UpdateIconVisibility(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 128 ScopedSessionObserver scoped_session_observer_; | 127 ScopedSessionObserver scoped_session_observer_; |
| 129 | 128 |
| 130 base::WeakPtrFactory<PaletteTray> weak_factory_; | 129 base::WeakPtrFactory<PaletteTray> weak_factory_; |
| 131 | 130 |
| 132 DISALLOW_COPY_AND_ASSIGN(PaletteTray); | 131 DISALLOW_COPY_AND_ASSIGN(PaletteTray); |
| 133 }; | 132 }; |
| 134 | 133 |
| 135 } // namespace ash | 134 } // namespace ash |
| 136 | 135 |
| 137 #endif // ASH_SYSTEM_PALETTE_PALETTE_TRAY_H_ | 136 #endif // ASH_SYSTEM_PALETTE_PALETTE_TRAY_H_ |
| OLD | NEW |