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

Side by Side Diff: ui/views/mus/window_manager_connection.h

Issue 2211253002: mus/views: Create a mus OSExchangeData::Provider stub, and use it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix DCHECK. Fixed unit tests? Created 4 years, 4 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
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_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_ 5 #ifndef UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_
6 #define UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_ 6 #define UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/observer_list.h" 16 #include "base/observer_list.h"
17 #include "services/shell/public/cpp/identity.h" 17 #include "services/shell/public/cpp/identity.h"
18 #include "services/ui/public/cpp/window_tree_client_delegate.h" 18 #include "services/ui/public/cpp/window_tree_client_delegate.h"
19 #include "ui/base/dragdrop/os_exchange_data_provider_factory.h"
19 #include "ui/views/mus/mus_export.h" 20 #include "ui/views/mus/mus_export.h"
20 #include "ui/views/mus/screen_mus_delegate.h" 21 #include "ui/views/mus/screen_mus_delegate.h"
21 #include "ui/views/widget/widget.h" 22 #include "ui/views/widget/widget.h"
22 23
23 namespace shell { 24 namespace shell {
24 class Connector; 25 class Connector;
25 } 26 }
26 27
27 namespace ui { 28 namespace ui {
28 class GpuService; 29 class GpuService;
(...skipping 13 matching lines...) Expand all
42 // . Provides a Screen implementation backed by mus. 43 // . Provides a Screen implementation backed by mus.
43 // . Provides a Clipboard implementation backed by mus. 44 // . Provides a Clipboard implementation backed by mus.
44 // . Creates and owns a WindowTreeClient. 45 // . Creates and owns a WindowTreeClient.
45 // . Registers itself as the factory for creating NativeWidgets so that a 46 // . Registers itself as the factory for creating NativeWidgets so that a
46 // NativeWidgetMus is created. 47 // NativeWidgetMus is created.
47 // WindowManagerConnection is a singleton and should be created early on. 48 // WindowManagerConnection is a singleton and should be created early on.
48 // 49 //
49 // TODO(sky): this name is now totally confusing. Come up with a better one. 50 // TODO(sky): this name is now totally confusing. Come up with a better one.
50 class VIEWS_MUS_EXPORT WindowManagerConnection 51 class VIEWS_MUS_EXPORT WindowManagerConnection
51 : public NON_EXPORTED_BASE(ui::WindowTreeClientDelegate), 52 : public NON_EXPORTED_BASE(ui::WindowTreeClientDelegate),
52 public ScreenMusDelegate { 53 public ScreenMusDelegate,
54 public ui::OSExchangeDataProviderFactory::Factory {
53 public: 55 public:
54 ~WindowManagerConnection() override; 56 ~WindowManagerConnection() override;
55 57
56 static std::unique_ptr<WindowManagerConnection> Create( 58 static std::unique_ptr<WindowManagerConnection> Create(
57 shell::Connector* connector, 59 shell::Connector* connector,
58 const shell::Identity& identity); 60 const shell::Identity& identity);
59 static WindowManagerConnection* Get(); 61 static WindowManagerConnection* Get();
60 static bool Exists(); 62 static bool Exists();
61 63
62 shell::Connector* connector() { return connector_; } 64 shell::Connector* connector() { return connector_; }
(...skipping 26 matching lines...) Expand all
89 91
90 // ui::WindowTreeClientDelegate: 92 // ui::WindowTreeClientDelegate:
91 void OnEmbed(ui::Window* root) override; 93 void OnEmbed(ui::Window* root) override;
92 void OnDidDestroyClient(ui::WindowTreeClient* client) override; 94 void OnDidDestroyClient(ui::WindowTreeClient* client) override;
93 void OnEventObserved(const ui::Event& event, ui::Window* target) override; 95 void OnEventObserved(const ui::Event& event, ui::Window* target) override;
94 96
95 // ScreenMusDelegate: 97 // ScreenMusDelegate:
96 void OnWindowManagerFrameValuesChanged() override; 98 void OnWindowManagerFrameValuesChanged() override;
97 gfx::Point GetCursorScreenPoint() override; 99 gfx::Point GetCursorScreenPoint() override;
98 100
101 // ui:OSExchangeDataProviderFactory::Factory:
102 std::unique_ptr<OSExchangeData::Provider> BuildProvider() override;
103
99 shell::Connector* connector_; 104 shell::Connector* connector_;
100 shell::Identity identity_; 105 shell::Identity identity_;
101 std::unique_ptr<ScreenMus> screen_; 106 std::unique_ptr<ScreenMus> screen_;
102 std::unique_ptr<ui::WindowTreeClient> client_; 107 std::unique_ptr<ui::WindowTreeClient> client_;
103 std::unique_ptr<ui::GpuService> gpu_service_; 108 std::unique_ptr<ui::GpuService> gpu_service_;
104 // Must be empty on destruction. 109 // Must be empty on destruction.
105 base::ObserverList<PointerWatcher, true> pointer_watchers_; 110 base::ObserverList<PointerWatcher, true> pointer_watchers_;
106 base::ObserverList<TouchEventWatcher, true> touch_event_watchers_; 111 base::ObserverList<TouchEventWatcher, true> touch_event_watchers_;
107 112
108 DISALLOW_COPY_AND_ASSIGN(WindowManagerConnection); 113 DISALLOW_COPY_AND_ASSIGN(WindowManagerConnection);
109 }; 114 };
110 115
111 } // namespace views 116 } // namespace views
112 117
113 #endif // UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_ 118 #endif // UI_VIEWS_MUS_WINDOW_MANAGER_CONNECTION_H_
OLDNEW
« no previous file with comments | « ui/views/mus/os_exchange_data_provider_mus.cc ('k') | ui/views/mus/window_manager_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698