Make castv2 performance test work.
[chromium-blink-merge.git] / ui / wm / public / scoped_drag_drop_disabler.h
blob4f708eede559f988107ab1b7b9f33ee254439fa9
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
3 // found in the LICENSE file.
5 #ifndef UI_WM_PUBLIC_SCOPED_DRAG_DROP_DISABLER_H_
6 #define UI_WM_PUBLIC_SCOPED_DRAG_DROP_DISABLER_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/aura/window_observer.h"
12 namespace aura {
13 class Window;
15 namespace client {
16 class DragDropClient;
18 // 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 // client on the window, and upon destruction, it restores the previous one.
21 class AURA_EXPORT ScopedDragDropDisabler : public WindowObserver {
22 public:
23 explicit ScopedDragDropDisabler(Window* window);
24 ~ScopedDragDropDisabler() override;
26 private:
27 // WindowObserver:
28 void OnWindowDestroyed(Window* window) override;
30 Window* window_;
31 DragDropClient* old_client_;
32 scoped_ptr<DragDropClient> new_client_;
34 DISALLOW_COPY_AND_ASSIGN(ScopedDragDropDisabler);
37 } // namespace client
38 } // namespace aura
40 #endif // UI_WM_PUBLIC_SCOPED_DRAG_DROP_DISABLER_H_