Add ability for NetLogLogger to gather data from more than just NetLog
[chromium-blink-merge.git] / ui / views / widget / desktop_aura / desktop_native_cursor_manager.h
blob9780f1555be265f1de425735ed4240bfc95dc8bd
1 // Copyright (c) 2012 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_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_
8 #include <set>
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "ui/views/views_export.h"
13 #include "ui/wm/core/native_cursor_manager.h"
15 namespace aura {
16 class WindowTreeHost;
19 namespace ui {
20 class CursorLoader;
23 namespace wm {
24 class NativeCursorManagerDelegate;
27 namespace views {
28 class DesktopCursorLoaderUpdater;
30 // A NativeCursorManager that performs the desktop-specific setting of cursor
31 // state. Similar to AshNativeCursorManager, it also communicates these changes
32 // to all root windows.
33 class VIEWS_EXPORT DesktopNativeCursorManager
34 : public wm::NativeCursorManager {
35 public:
36 DesktopNativeCursorManager(
37 scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater);
38 ~DesktopNativeCursorManager() override;
40 // Builds a cursor and sets the internal platform representation. The return
41 // value should not be cached.
42 gfx::NativeCursor GetInitializedCursor(int type);
44 // Adds |host| to the set |hosts_|.
45 void AddHost(aura::WindowTreeHost* host);
47 // Removes |host| from the set |hosts_|.
48 void RemoveHost(aura::WindowTreeHost* host);
50 private:
51 // Overridden from wm::NativeCursorManager:
52 void SetDisplay(const gfx::Display& display,
53 wm::NativeCursorManagerDelegate* delegate) override;
54 void SetCursor(gfx::NativeCursor cursor,
55 wm::NativeCursorManagerDelegate* delegate) override;
56 void SetVisibility(bool visible,
57 wm::NativeCursorManagerDelegate* delegate) override;
58 void SetCursorSet(ui::CursorSetType cursor_set,
59 wm::NativeCursorManagerDelegate* delegate) override;
60 void SetMouseEventsEnabled(
61 bool enabled,
62 wm::NativeCursorManagerDelegate* delegate) override;
64 // The set of hosts to notify of changes in cursor state.
65 typedef std::set<aura::WindowTreeHost*> Hosts;
66 Hosts hosts_;
68 scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater_;
69 scoped_ptr<ui::CursorLoader> cursor_loader_;
71 DISALLOW_COPY_AND_ASSIGN(DesktopNativeCursorManager);
74 } // namespace views
76 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_