Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: ash/system/audio/tray_audio.h

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/sticky_keys/sticky_keys_unittest.cc ('k') | ash/system/audio/tray_audio.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_AUDIO_TRAY_AUDIO_H_ 5 #ifndef ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_
6 #define ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_ 6 #define ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory>
11
10 #include "ash/system/audio/audio_observer.h" 12 #include "ash/system/audio/audio_observer.h"
11 #include "ash/system/tray/tray_image_item.h" 13 #include "ash/system/tray/tray_image_item.h"
12 #include "base/macros.h" 14 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "ui/gfx/display_observer.h" 15 #include "ui/gfx/display_observer.h"
15 16
16 namespace ash { 17 namespace ash {
17 18
18 namespace system { 19 namespace system {
19 class TrayAudioDelegate; 20 class TrayAudioDelegate;
20 } 21 }
21 22
22 namespace tray { 23 namespace tray {
23 class VolumeView; 24 class VolumeView;
24 } 25 }
25 26
26 class TrayAudio : public TrayImageItem, 27 class TrayAudio : public TrayImageItem,
27 public AudioObserver, 28 public AudioObserver,
28 public gfx::DisplayObserver { 29 public gfx::DisplayObserver {
29 public: 30 public:
30 TrayAudio(SystemTray* system_tray, 31 TrayAudio(SystemTray* system_tray,
31 scoped_ptr<system::TrayAudioDelegate> audio_delegate); 32 std::unique_ptr<system::TrayAudioDelegate> audio_delegate);
32 ~TrayAudio() override; 33 ~TrayAudio() override;
33 34
34 static bool ShowAudioDeviceMenu(); 35 static bool ShowAudioDeviceMenu();
35 36
36 protected: 37 protected:
37 // Overridden from gfx::DisplayObserver. 38 // Overridden from gfx::DisplayObserver.
38 void OnDisplayAdded(const gfx::Display& new_display) override; 39 void OnDisplayAdded(const gfx::Display& new_display) override;
39 void OnDisplayRemoved(const gfx::Display& old_display) override; 40 void OnDisplayRemoved(const gfx::Display& old_display) override;
40 void OnDisplayMetricsChanged(const gfx::Display& display, 41 void OnDisplayMetricsChanged(const gfx::Display& display,
41 uint32_t changed_metrics) override; 42 uint32_t changed_metrics) override;
42 43
43 virtual void Update(); 44 virtual void Update();
44 45
45 scoped_ptr<system::TrayAudioDelegate> audio_delegate_; 46 std::unique_ptr<system::TrayAudioDelegate> audio_delegate_;
46 tray::VolumeView* volume_view_; 47 tray::VolumeView* volume_view_;
47 48
48 // True if VolumeView should be created for accelerator pop up; 49 // True if VolumeView should be created for accelerator pop up;
49 // Otherwise, it should be created for detailed view in ash tray bubble. 50 // Otherwise, it should be created for detailed view in ash tray bubble.
50 bool pop_up_volume_view_; 51 bool pop_up_volume_view_;
51 52
52 private: 53 private:
53 // Overridden from TrayImageItem. 54 // Overridden from TrayImageItem.
54 bool GetInitialVisibility() override; 55 bool GetInitialVisibility() override;
55 56
(...skipping 13 matching lines...) Expand all
69 void OnActiveInputNodeChanged() override; 70 void OnActiveInputNodeChanged() override;
70 71
71 void ChangeInternalSpeakerChannelMode(); 72 void ChangeInternalSpeakerChannelMode();
72 73
73 DISALLOW_COPY_AND_ASSIGN(TrayAudio); 74 DISALLOW_COPY_AND_ASSIGN(TrayAudio);
74 }; 75 };
75 76
76 } // namespace ash 77 } // namespace ash
77 78
78 #endif // ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_ 79 #endif // ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_
OLDNEW
« no previous file with comments | « ash/sticky_keys/sticky_keys_unittest.cc ('k') | ash/system/audio/tray_audio.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698