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

Side by Side Diff: ui/wm/public/scoped_drag_drop_disabler.h

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr 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 | « ui/wm/core/wm_state.h ('k') | ui/wm/test/wm_test_helper.h » ('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 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 UI_WM_PUBLIC_SCOPED_DRAG_DROP_DISABLER_H_ 5 #ifndef UI_WM_PUBLIC_SCOPED_DRAG_DROP_DISABLER_H_
6 #define UI_WM_PUBLIC_SCOPED_DRAG_DROP_DISABLER_H_ 6 #define UI_WM_PUBLIC_SCOPED_DRAG_DROP_DISABLER_H_
7 7
8 #include <memory>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/aura/window_observer.h" 11 #include "ui/aura/window_observer.h"
11 12
12 namespace aura { 13 namespace aura {
13 class Window; 14 class Window;
14 15
15 namespace client { 16 namespace client {
16 class DragDropClient; 17 class DragDropClient;
17 18
18 // ScopedDragDropDisabler is used to temporarily replace the drag'n'drop client 19 // ScopedDragDropDisabler is used to temporarily replace the drag'n'drop client
19 // for a window with a "no-op" client. Upon construction, it installs a new 20 // for a window with a "no-op" client. Upon construction, it installs a new
20 // client on the window, and upon destruction, it restores the previous one. 21 // client on the window, and upon destruction, it restores the previous one.
21 class AURA_EXPORT ScopedDragDropDisabler : public WindowObserver { 22 class AURA_EXPORT ScopedDragDropDisabler : public WindowObserver {
22 public: 23 public:
23 explicit ScopedDragDropDisabler(Window* window); 24 explicit ScopedDragDropDisabler(Window* window);
24 ~ScopedDragDropDisabler() override; 25 ~ScopedDragDropDisabler() override;
25 26
26 private: 27 private:
27 // WindowObserver: 28 // WindowObserver:
28 void OnWindowDestroyed(Window* window) override; 29 void OnWindowDestroyed(Window* window) override;
29 30
30 Window* window_; 31 Window* window_;
31 DragDropClient* old_client_; 32 DragDropClient* old_client_;
32 scoped_ptr<DragDropClient> new_client_; 33 std::unique_ptr<DragDropClient> new_client_;
33 34
34 DISALLOW_COPY_AND_ASSIGN(ScopedDragDropDisabler); 35 DISALLOW_COPY_AND_ASSIGN(ScopedDragDropDisabler);
35 }; 36 };
36 37
37 } // namespace client 38 } // namespace client
38 } // namespace aura 39 } // namespace aura
39 40
40 #endif // UI_WM_PUBLIC_SCOPED_DRAG_DROP_DISABLER_H_ 41 #endif // UI_WM_PUBLIC_SCOPED_DRAG_DROP_DISABLER_H_
OLDNEW
« no previous file with comments | « ui/wm/core/wm_state.h ('k') | ui/wm/test/wm_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698