| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROME_BROWSER_UI_ASH_PALETTE_DELEGATE_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_PALETTE_DELEGATE_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_PALETTE_DELEGATE_CHROMEOS_H_ | 6 #define CHROME_BROWSER_UI_ASH_PALETTE_DELEGATE_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ash/common/palette_delegate.h" | 10 #include "ash/common/palette_delegate.h" |
| 11 #include "ash/common/session/session_state_observer.h" | 11 #include "ash/common/session/session_state_observer.h" |
| 12 #include "base/callback_list.h" | 12 #include "base/callback_list.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/weak_ptr.h" |
| 14 #include "base/values.h" | 15 #include "base/values.h" |
| 15 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 17 #include "ui/events/devices/input_device_event_observer.h" | 18 #include "ui/events/devices/input_device_event_observer.h" |
| 18 | 19 |
| 19 class PrefChangeRegistrar; | 20 class PrefChangeRegistrar; |
| 20 class Profile; | 21 class Profile; |
| 21 | 22 |
| 22 namespace ash { | 23 namespace ash { |
| 23 class ScopedSessionStateObserver; | 24 class ScopedSessionStateObserver; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 36 static std::unique_ptr<PaletteDelegateChromeOS> Create(); | 37 static std::unique_ptr<PaletteDelegateChromeOS> Create(); |
| 37 | 38 |
| 38 ~PaletteDelegateChromeOS() override; | 39 ~PaletteDelegateChromeOS() override; |
| 39 | 40 |
| 40 void OnLaserPointerEnabled() override; | 41 void OnLaserPointerEnabled() override; |
| 41 void OnLaserPointerDisabled() override; | 42 void OnLaserPointerDisabled() override; |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 PaletteDelegateChromeOS(); | 45 PaletteDelegateChromeOS(); |
| 45 | 46 |
| 47 class ProxyScreenshotDelegate; |
| 48 |
| 46 // ash::PaletteDelegate: | 49 // ash::PaletteDelegate: |
| 47 std::unique_ptr<EnableListenerSubscription> AddPaletteEnableListener( | 50 std::unique_ptr<EnableListenerSubscription> AddPaletteEnableListener( |
| 48 const EnableListener& on_state_changed) override; | 51 const EnableListener& on_state_changed) override; |
| 49 void CreateNote() override; | 52 void CreateNote() override; |
| 50 bool HasNoteApp() override; | 53 bool HasNoteApp() override; |
| 51 void SetPartialMagnifierState(bool enabled) override; | 54 void SetPartialMagnifierState(bool enabled) override; |
| 52 void SetStylusStateChangedCallback( | 55 void SetStylusStateChangedCallback( |
| 53 const OnStylusStateChangedCallback& on_stylus_state_changed) override; | 56 const OnStylusStateChangedCallback& on_stylus_state_changed) override; |
| 54 bool ShouldAutoOpenPalette() override; | 57 bool ShouldAutoOpenPalette() override; |
| 55 bool ShouldShowPalette() override; | 58 bool ShouldShowPalette() override; |
| 56 void TakeScreenshot() override; | 59 void TakeScreenshot() override; |
| 57 void TakePartialScreenshot() override; | 60 void TakePartialScreenshot(const base::Closure& done) override; |
| 61 void CancelPartialScreenshot() override; |
| 58 | 62 |
| 59 // ash::SessionStateObserver: | 63 // ash::SessionStateObserver: |
| 60 void ActiveUserChanged(const AccountId& account_id) override; | 64 void ActiveUserChanged(const AccountId& account_id) override; |
| 61 | 65 |
| 62 // content::NotificationObserver: | 66 // content::NotificationObserver: |
| 63 void Observe(int type, | 67 void Observe(int type, |
| 64 const content::NotificationSource& source, | 68 const content::NotificationSource& source, |
| 65 const content::NotificationDetails& details) override; | 69 const content::NotificationDetails& details) override; |
| 66 | 70 |
| 67 // ui::InputDeviceObserver: | 71 // ui::InputDeviceObserver: |
| 68 void OnStylusStateChanged(ui::StylusState state) override; | 72 void OnStylusStateChanged(ui::StylusState state) override; |
| 69 | 73 |
| 70 // Called when the palette enabled pref has changed. | 74 // Called when the palette enabled pref has changed. |
| 71 void OnPaletteEnabledPrefChanged(); | 75 void OnPaletteEnabledPrefChanged(); |
| 72 | 76 |
| 73 void SetProfile(Profile* profile); | 77 void SetProfile(Profile* profile); |
| 78 void OnPartialScreenshotDone(const base::Closure& then); |
| 74 | 79 |
| 75 base::CallbackList<void(bool)> palette_enabled_callback_list_; | 80 base::CallbackList<void(bool)> palette_enabled_callback_list_; |
| 76 OnStylusStateChangedCallback on_stylus_state_changed_; | 81 OnStylusStateChangedCallback on_stylus_state_changed_; |
| 77 | 82 |
| 83 std::unique_ptr<ProxyScreenshotDelegate> proxy_screenshot_delegate_; |
| 84 |
| 78 // Unowned pointer to the active profile. | 85 // Unowned pointer to the active profile. |
| 79 Profile* profile_ = nullptr; | 86 Profile* profile_ = nullptr; |
| 80 std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_; | 87 std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_; |
| 81 std::unique_ptr<ash::ScopedSessionStateObserver> session_state_observer_; | 88 std::unique_ptr<ash::ScopedSessionStateObserver> session_state_observer_; |
| 82 content::NotificationRegistrar registrar_; | 89 content::NotificationRegistrar registrar_; |
| 83 | 90 |
| 91 base::WeakPtrFactory<PaletteDelegateChromeOS> weak_factory_; |
| 92 |
| 84 DISALLOW_COPY_AND_ASSIGN(PaletteDelegateChromeOS); | 93 DISALLOW_COPY_AND_ASSIGN(PaletteDelegateChromeOS); |
| 85 }; | 94 }; |
| 86 | 95 |
| 87 } // namespace chromeos | 96 } // namespace chromeos |
| 88 | 97 |
| 89 #endif // CHROME_BROWSER_UI_ASH_PALETTE_DELEGATE_CHROMEOS_H_ | 98 #endif // CHROME_BROWSER_UI_ASH_PALETTE_DELEGATE_CHROMEOS_H_ |
| OLD | NEW |