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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; | 59 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; |
60 void AnchorUpdated() override; | 60 void AnchorUpdated() override; |
61 void Initialize() override; | 61 void Initialize() 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 // Returns true if the shelf should not autohide. | |
70 bool ShouldBlockShelfAutoHide() const; | |
71 | |
72 // Opens up the palette if it is not already open. Returns true if the palette | 69 // Opens up the palette if it is not already open. Returns true if the palette |
73 // was opened. | 70 // was opened. |
74 bool ShowPalette(); | 71 bool ShowPalette(); |
75 | 72 |
76 // Returns true if the palette tray contains the given point. This is useful | 73 // Returns true if the palette tray contains the given point. This is useful |
77 // for determining if an event should be propagated through to the palette. | 74 // for determining if an event should be propagated through to the palette. |
78 bool ContainsPointInScreen(const gfx::Point& point); | 75 bool ContainsPointInScreen(const gfx::Point& point); |
79 | 76 |
80 private: | 77 private: |
81 // ui::InputDeviceObserver: | 78 // ui::InputDeviceObserver: |
(...skipping 28 matching lines...) Expand all Loading... |
110 std::unique_ptr<TrayBubbleWrapper> bubble_; | 107 std::unique_ptr<TrayBubbleWrapper> bubble_; |
111 | 108 |
112 // Manages the callback OnPaletteEnabledPrefChanged callback registered to | 109 // Manages the callback OnPaletteEnabledPrefChanged callback registered to |
113 // the PaletteDelegate instance. | 110 // the PaletteDelegate instance. |
114 std::unique_ptr<PaletteDelegate::EnableListenerSubscription> | 111 std::unique_ptr<PaletteDelegate::EnableListenerSubscription> |
115 palette_enabled_subscription_; | 112 palette_enabled_subscription_; |
116 | 113 |
117 // Weak pointer, will be parented by TrayContainer for its lifetime. | 114 // Weak pointer, will be parented by TrayContainer for its lifetime. |
118 views::ImageView* icon_; | 115 views::ImageView* icon_; |
119 | 116 |
120 // The shelf auto-hide state is checked during the tray constructor, so we | |
121 // have to use a helper variable instead of just checking if we have a tray | |
122 // instance. | |
123 bool should_block_shelf_auto_hide_ = false; | |
124 | |
125 // Cached palette enabled/disabled pref value. | 117 // Cached palette enabled/disabled pref value. |
126 bool is_palette_enabled_ = true; | 118 bool is_palette_enabled_ = true; |
127 | 119 |
128 // Used to indicate whether the palette bubble is automatically opened by a | 120 // Used to indicate whether the palette bubble is automatically opened by a |
129 // stylus eject event. | 121 // stylus eject event. |
130 bool is_bubble_auto_opened_ = false; | 122 bool is_bubble_auto_opened_ = false; |
131 | 123 |
132 // Number of actions in pen palette bubble. | 124 // Number of actions in pen palette bubble. |
133 int num_actions_in_bubble_ = 0; | 125 int num_actions_in_bubble_ = 0; |
134 | 126 |
135 ScopedSessionObserver scoped_session_observer_; | 127 ScopedSessionObserver scoped_session_observer_; |
136 | 128 |
137 base::WeakPtrFactory<PaletteTray> weak_factory_; | 129 base::WeakPtrFactory<PaletteTray> weak_factory_; |
138 | 130 |
139 DISALLOW_COPY_AND_ASSIGN(PaletteTray); | 131 DISALLOW_COPY_AND_ASSIGN(PaletteTray); |
140 }; | 132 }; |
141 | 133 |
142 } // namespace ash | 134 } // namespace ash |
143 | 135 |
144 #endif // ASH_SYSTEM_PALETTE_PALETTE_TRAY_H_ | 136 #endif // ASH_SYSTEM_PALETTE_PALETTE_TRAY_H_ |
OLD | NEW |